[Release] Няколко модула за DrakE Web на NikeR

Dea7h

Admiral General Aladeen
Joined
Jan 16, 2009
Messages
1,189
Reaction score
428
Здравейте, реших да направя няколко модула за Дрейк Уеба на лиско и се надявам да ви харесат и да ги ползвате, ако имате проблеми с тях пишете и ще се опитам да ви помогна.
Не са нещо кои знае какво но ... толкова :D
И така ето първия:

Stone Exchange Module
Служи за размяна на стонета срещу зен.

Инсталация:
1-во слагате следната функция в drake.class.php
PHP:
function exchange()
{

$stones = secure($_POST['stones']);
$account = secure($_SESSION['user']);

check_inject();

global $exchangeStone;


$stoneq = mssql_query("Select StoneCount FROM T_BLOOD_CASTLE WHERE AccountID ='$account'");
$stone = mssql_fetch_row($stoneq);

$moneyq = mssql_query("Select Money FROM warehouse WHERE AccountID ='$account'");
$money = mssql_fetch_row($moneyq);

$statusaq = mssql_query("select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$statusa = mssql_num_rows($statusaq);

$moneyToEx = $exchangeStone * $stones;
$newmoney = $money[0] + $exchangeStone * $stones;
$newstones = $stone[0] - $stones;

if(empty($stones)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Stone/s for exchange !</td></tr>"; $error=1; }
else{
if($statusa != 0) { echo"<tr><td align='center' class='modules'><b>Error:</b> Your account Is Online ! Please Log Off !</td></tr>"; $error=1; }
if($stone[0] <= $stones) { echo"<tr><td align='center' class='modules'><b>Error:</b> You don't have $stones stones !</td></tr>"; $error=1; }

if($error != 1) {
echo"<tr><td align='center' class='modules'><span class='online'>You exchange successfully $stones stones for $moneyToEx zen !</span></td></tr>";
$mssqlq = "
Update T_BLOOD_CASTLE Set StoneCount='$newstones' where AccountID='$account'
Update warehouse Set Money='$newmoney' where AccountID='$account'
";}
mssql_query($mssqlq);
}}
2-ро слагате този код в конфиг файла(includes/config.php):
PHP:
$exchangeStone = '10000000'; //Zen for 1 stone
3-то слагате прикачения файл StoneExchange.rar (разархивиран :D: ) в modules/user

Already Account Connected Fix Module
Със сигурност знаете какъв е този модул (chuckle)
И така .. инсталл
Слагате тази функция в includes/drake.class.php :
PHP:
function already_conn_fix()
{
$account = secure($_SESSION['user']);
check_inject();

$statusaq = mssql_query("select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$statusa = mssql_num_rows($statusaq);

if(empty($account)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please login on system !</td></tr>"; $error=1; }
else{
if($statusa <= 0) { echo"<tr><td align='center' class='modules'><b>Error:</b> Your account don't have need to fix !</td></tr>"; $error=1; }

if($error != 1) {
echo"<tr><td align='center' class='modules'><span class='online'>Account $account has successfully fixed !</span></td></tr>";
$a = "Update MEMB_STAT Set ConnectStat='0' where memb___id='$account'";
$go = mssql_query($a);
}}}
2-ро слагате прикачения файл в modules/user (отново да кажа разархивиран)

Ако искате модула да ви излиза само когато юзъра има нужда от него (когато му излиза Already Connected...)
в modules/user.php пишете този код под примерно последната опция (Reset Char или каквато ви е там ...)

PHP:
<?
$username = secure($_SESSION['user']);
$check = mssql_num_rows(mssql_query("Select * from MEMB_STAT where memb___id='$username' and connectstat='1'"));
        if ($check == "1") 
		{
			echo "
			<tr><td align='center'><a href='index.php?op=user&char=already_fix'>Already Account Connect Fix</a></td></tr>
			";
			}
		else {}
?>

GM Modules - Ban/Unban Characters/Accounts Only for GM ;)
И така... ето и ГМ модула :)
1-ва стъпка слагате тези функцийки в includes/drake.class.php
PHP:
function ban_chr()
{
$character = secure($_POST['character']);
$account = secure($_SESSION['user']);

check_inject();

if(empty($character)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Character for ban !</td></tr>"; $error=1; }
else{

if($error != 1) {
echo"<tr><td align='center' class='modules'><span class='online'>You successfully banned $character !</span></td></tr>";
$mssqlq = "
Update character Set CtlCode='1' where Name='$character'
";}
mssql_query($mssqlq);
}}

function unban_chr()
{
$character = secure($_POST['character']);
$account = secure($_SESSION['user']);

check_inject();

if(empty($character)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Character for unblock !</td></tr>"; $error=1; }
else{

if($error != 1) {
echo"<tr><td align='center' class='modules'><span class='online'>You successfully Unblocked $character !</span></td></tr>";
$mssqlq = "
Update character Set CtlCode='0' where Name='$character'
";}
mssql_query($mssqlq);
}}


function ban_acc()
{$account = secure($_POST['account']);
check_inject();

if(empty($account)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Account for block !</td></tr>"; $error=1; }
else{

if($error != 1) {
echo"<tr><td align='center' class='modules'><span class='online'>You successfully blocked $account !</span></td></tr>";
$mssqlq = "
Update MEMB_INFO Set bloc_code='1' where memb___id='$account'
";}
mssql_query($mssqlq);
}}

function unban_acc()
{
$account = secure($_POST['account']);
check_inject();

if(empty($account)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Account for Unblock !</td></tr>"; $error=1; }
else{

if($error != 1) {
echo"<tr><td align='center' class='modules'><span class='online'>You successfully Unblocked $account !</span></td></tr>";
$mssqlq = "
Update MEMB_INFO Set bloc_code='0' where memb___id='$account'
";}
mssql_query($mssqlq);
}}

2-ра стъпка слагате 2-та файла в modules/user (от прикачения файл)

и слагате този ред в конфиг файла (includes/config.php)
PHP:
$AdminCtl = '24'; //Admin CTL Code
като от там гласите админ с какви права може да използва модула :)
И накрая слагате този код в modules/user.php
PHP:
<?
include "includes/config.php";
$username = secure($_SESSION['user']);
$check = mssql_num_rows(mssql_query("SELECT * from Character where AccountID='$username' and CtlCode='$AdminCtl'"));
        if ($check == "1")
        {
			echo "
			<tr><td align='center'><a href='index.php?op=user&char=banchrs'>*** Block / Unblock Characters ***</a></td></tr>
			<tr><td align='center'><a href='index.php?op=user&char=banaccs'>*** Block / Unblock Accounts ***</a></td></tr>
			";
		}
		else
		{
		}
?>


Stats Fix Module
И така... ето ви статс фикс модула :)
Слагате тези 2 функцийки в includes/drake.class.php
PHP:
function stats_fix() { 

$character = secure($_POST['character']);
$account = secure($_SESSION['user']);
check_inject();

$charq = mssql_query("Select AccountID,leveluppoint,Strength,Dexterity,Vitality,Energy from Character where name='$character'");
$char = mssql_fetch_row($charq);

$UpPoints = $char[1]+$char[2]+$char[3]+$char[4]+$char[5] - 100;

$statusaq = mssql_query("select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$statusa = mssql_num_rows($statusaq);

if($statusa != 0) { $statusq = mssql_query("select GameIDC From AccountCharacter where Id='$account'"); $statusr = mssql_fetch_row($statusq); }
if(empty($character)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Character !</td></tr>"; $error=1; }
else{
if($statusr[0] == $character) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character Is Online ! Please Log Off !</td></tr>"; $error=1; }
if($char[0] != $account) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please login on system and come back !</td></tr>"; $error=1; }

if($error != 1)
{
echo"<tr><td align='center' class='modules'><span class='online'>Points Successfuly fixed and now $character have $UpPoints points to add ! </span></td></tr>";

$a = mssql_query("Update Character set leveluppoint='$UpPoints',Strength='25',Dexterity='25',Vitality='25',Energy='25' where name='$character'");
}}}


function stats_fix2() { 

$character = secure($_POST['character']);
$account = secure($_SESSION['user']);
check_inject();

$charq = mssql_query("Select AccountID,leveluppoint,Leadership,class from Character where name='$character'");
$char = mssql_fetch_row($charq);

$UpPoints = $char[1]+$char[2] - 25;

$statusaq = mssql_query("select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$statusa = mssql_num_rows($statusaq);

if($statusa != 0) { $statusq = mssql_query("select GameIDC From AccountCharacter where Id='$account'"); $statusr = mssql_fetch_row($statusq); }
if(empty($character)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Character !</td></tr>"; $error=1; }
else{
if($statusr[0] == $character) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character Is Online ! Please Log Off !</td></tr>"; $error=1; }
if($char[3] != 64 or 66) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character has not have command !</td></tr>"; $error=1; }

if($error != 1)
{
echo"<tr><td align='center' class='modules'><span class='online'>Command Points Successfuly fixed and now $character have $UpPoints points to add ! </span></td></tr>";

$a = mssql_query("Update Character set leveluppoint='$UpPoints',Leadership='25' where name='$character'");
}}}

И прикачения файл в modules/user.


Grand Reset Modules - Exchange for items (или поне нещо от тоя род :D)

От сега искам да кажа че може да правите гранд ресове след като сте направили обикновенните ресове на макс.
Също така и че не добавя итемите сама ами ги вписва в "изчакващи" и админа трябва ръчно да ги добавя ...
Който не му харесва ... да не я ползва... :)
И така ето функцийката:
PHP:
function greset_character()
{
$character = secure($_POST['character']);
$account = secure($_SESSION['user']);

check_inject();

global $gresetlevel;
global $gresetpoints;
global $gresetmoney;
global $gmaxresets;
global $resetpoints;
global $maxresets;


$charq = mssql_query("Select clevel,leveluppoint,money,Resets,GReset from Character where name='$character'");
$char = mssql_fetch_row($charq);

$statusaq = mssql_query("select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$statusa = mssql_num_rows($statusaq);
if($statusa != 0) { $statusq = mssql_query("select GameIDC From AccountCharacter where Id='$account'"); $statusr = mssql_fetch_row($statusq); }

$newresets = $char[4] + (1);
$newmoney = $char[2] - $gresetmoney;
$newpoints = $char[3] * $resetpoints + $char[4] * $gresetpoints;

if(empty($character)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Character !</td></tr>"; $error=1; }
else{
if($statusr[0] == $character) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character Is Online ! Please Log Off !</td></tr>"; $error=1; }
if($char[0] < $gresetlevel) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't got $gresetlevel to reset !</td></tr>"; $error=1; }
if($char[2] < $gresetmoney) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't god enought money to reset !</td></tr>"; $error=1; }
if($newresets > $gmaxresets) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character have reached the maximum grand resets !</td></tr>"; $error=1; }
if($char[3] < $maxresets) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character don't have maximum resets to make Grand Resets !</td></tr>"; $error=1; }


if($error != 1) {
echo"<tr><td align='center' class='modules'><span class='online'>Character $character has successfuly make grand reset !</span></td></tr>";
$mssqlq = "
Update Character Set Strength='25',Dexterity='25',Vitality='25',Energy='25',Money='$newmoney',clevel='1',Experience='0',LevelUpPoint='$newpoints', GReset='$newresets' where name='$character'
";}
mssql_query($mssqlq);
}}


function exchange_greset()
{
$character = secure($_POST['character']);
$exch_item = secure($_POST['exchange_item']);
$account = secure($_SESSION['user']);
check_inject();

global $GResForItem;

$charq = mssql_query("Select GReset from Character where name='$character'");
$char = mssql_fetch_row($charq);

$newgresets = $char[0] - $GResForItem;
if(empty($exch_item) or empty($character)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Character and Item !</td></tr>"; $error=1; }
else{
if($char[0] < $GResForItem) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character don't have $GResForItem grand resets for get this item!</td></tr>"; $error=1; }

if($error != 1) {
echo"<tr><td align='center' class='modules'><span class='online'>Character $character has successfuly exchange $GResForItem grand resets for $exch_item !</span></td></tr>";
echo"<tr><td align='center' class='modules'><span class='online'>$exch_item item will be added soon !</span></td></tr>";
$mssqlq = "
Update Character Set GReset='$newgresets' where name='$character'
INSERT INTO exchangeitems (account,itemname,character) VALUES ('$account','$exch_item','$character')
";}
mssql_query($mssqlq);
}}

След това добавяте тези редове в config.php файла:
PHP:
$gresetlevel = '350'; // tova e levela za res pri Grand Resa
$gresetpoints = '200'; //to4kite na res pri GR..
$gresetmoney = '50000000'; // Kolko stotinki da zima za GR :D
$gmaxresets = '50'; //kolko da e max resovete pri Grand Reset
$gresforitem = '30'; //Kolko Grand resa da vzima za 1 pora4an item ..

Добавяте следната таблица в Query Analyzer
Code:
CREATE TABLE [exchangeitems] (
	[account] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL,
	[itemname] [varchar] (60) COLLATE Chinese_PRC_CI_AS NULL,
	[character] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

И накрая слагате прикачения файл в modules/user

едит:Забравих да кажа че итемите се променят от файла modules/user/exchange_greset.php (от самия модул ...)

Пак казвам, ако не ви харесва не я използвайте (nod)

Reset Character Module (работещ ресет модул)

Просто заменяте функцията със старата reset_character(); :
PHP:
function reset_character()
{
$character = secure($_POST['character']);
$account = secure($_SESSION['user']);

check_inject();

global $resetlevel;
global $resettype;
global $resetpoints;
global $resetmoney;
global $maxresets;


$charq = mssql_query("Select clevel,leveluppoint,money,Resets from Character where name='$character'");
$char = mssql_fetch_row($charq);

$statusaq = mssql_query("select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$statusa = mssql_num_rows($statusaq);
if($statusa != 0) { $statusq = mssql_query("select GameIDC From AccountCharacter where Id='$account'"); $statusr = mssql_fetch_row($statusq); }

$newresets = $char[3] + 1;
$newmoney = $char[2] - $resetmoney * $char[3];
$newpoints = $newresets * $resetpoints;
$moneyforres = $resetmoney * $newresets;

if(empty($character)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Character !</td></tr>"; $error=1; }
else{
if($statusr[0] == $character) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character Is Online ! Please Log Off !</td></tr>"; $error=1; }
if($char[0] < $resetlevel) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't got $resetlevel to reset !</td></tr>"; $error=1; }
if($char[2] < $moneyforres) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't god enought money to reset !</td></tr>"; $error=1; }
if($newresets > $maxresets) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character have reached the maximum resets !</td></tr>"; $error=1; }

if($error != 1) {
echo"<tr><td align='center' class='modules'><span class='online'>Character $character has successfuly reset !</span></td></tr>";
if($resettype == keep) {$mssql = mssql_query("Update Character Set Money='$newmoney',clevel='1',Experience='0',Resets='$newresets' where name='$character'");}
elseif($resettype == bonus) {$mssql = mssql_query("Update Character Set Money='$newmoney',clevel='1',Experience='0',Resets='$newresets',LevelUpPoint='$newpoints' where name='$character'");}
elseif($resettype == reset) {$mssql = mssql_query("Update Character Set Strength='25',Dexterity='25',Vitality='25',Energy='25',Money='$newmoney',clevel='1',Experience='0',LevelUpPoint='$newpoints', Resets='$newresets' where name='$character'");}
}}}

3rd Complete Quest Module
Това е модул за изпълняване на 3-тия куест (за по-новите версий)

Слагате функцията в drake.class.php
PHP:
function tree_quest()
{
$character = secure($_POST['character']);
$account = secure($_SESSION['user']);

check_inject();

$charq = mssql_query("Select class from Character where name='$character'");
$char = mssql_fetch_row($charq);

if($char[0] == 1) {$newclass =  2; }
elseif ($char[0] == 17) {$newclass = 18; }
elseif ($char[0] == 33) {$newclass = 34; }
elseif ($char[0] == 48) {$newclass = 50; }
elseif ($char[0] == 64) {$newclass = 66; }

$statusaq = mssql_query("select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$statusa = mssql_num_rows($statusaq);
if($statusa != 0) { $statusq = mssql_query("select GameIDC From AccountCharacter where Id='$account'"); $statusr = mssql_fetch_row($statusq); }

if(empty($character)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Character !</td></tr>"; $error=1; }
else{
if($statusr[0] == $character) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character Is Online ! Please Log Off !</td></tr>"; $error=1; }
if($char[0] == 0 or $char[0] == 16 or $char[0] == 32) { echo"<tr><td align='center' class='modules'><b>Error:</b> Before you complete 3rd quest, you need to complete 2nd quest !</td></tr>"; $error=1; }
if($char[0] == 2 or $char[0] == 18 or $char[0] == 34 or $char[0] == 50 or $char[0] == 66) { echo"<tr><td align='center' class='modules'><b>Error:</b> You are completed 3rd quest !</td></tr>"; $error=1; }
if($error != 1)
{
echo"<tr><td align='center' class='modules'><span class='online'>3rd Quest is completed on character $character !</span></td></tr>";

$a = mssql_query("Update Character set class='$newclass' where name='$character'");
}}}
и прикачения файл в modules/user ... това е :)


Vote and Continue
Това е модул който задължава потребителите да гласуват на даден линк на всеки 24 часа иначе немогат да използват функцийте в сайта. :)

За целта правите нов файл с името vote.php в папката modules със следното съдържание:
PHP:
<form action='' name='' method='post'>
Трябва 1-vo да гласувате za da prodaljite ... :D i tn <a href='http://google.bg/' target='_blank'><input type='submit' name='vote' id='vote' value='Vote now !'></a>
</form>
<? if(!isset($_POST['vote'])) {} else { vote_link(); } ?>

След това слагате този код най отгоре във файла user.php:
PHP:
<?
$time = time();
$time2 = $time - 86400;
$account = $_SESSION['user'];

$accq = mssql_query("Select * from votes where account='$account' and time>'$time2'");
$acc = mssql_num_rows($accq);

if($acc == "0") {
header ('Location: ?op=vote');
exit;}
else {}
?>

После влизате в query analyzer и създаваде следната таблица в дата базата MuOnline със следния код:
Code:
CREATE TABLE [votes] (
	[account] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL,
	[time] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

И накрая слагате следната функция в includes/drake.class.php :
PHP:
function vote_link() {
$account = secure($_SESSION['user']);
$vote = secure($_POST['vote']);
check_inject();

$time = time();
$time2 = $time - 86400;

$accq = mssql_query("Select * from votes where account='$account'");
$acc = mssql_num_rows($accq);

if ($acc == 0 and $_SESSION['user'] == true){ 
$a = mssql_query("INSERT INTO votes (account,time) VALUES ('$account','$time')");
echo "<meta http-equiv=\"refresh\" content=\"0;url=?op=user\">";
}
elseif ($acc != 0 and $_SESSION['user'] == true) {
$a = mssql_query("Update votes Set account='$account', time='$time' where account='$account'");
echo "<meta http-equiv=\"refresh\" content=\"0;url=?op=user\">";
}}

Линкът за гласуване се променя от файла vote.php, на мястото на "http://google.bg/" пишете вашият линк :)

Надявам се да ви хареса :p

Сложих прикачените файлове в един общ рар понеже нямаше място за повече :)

Това са модулите за сега, ако на някой му трябва някой модул може да пише в темата и ще се опитам да помогна !

Скоро очаквайте и други ... :p
Ако съм пропуснал нещо или имам грешка, кажете и ще я поправя. :)

Ако съм ви помогнал с нещо, моля използвайте Thanks бутона. Благодаря ;)
 

Attachments

  • DrakE Web Modules by Dea7h ;p.rar
    6.3 KB · Views: 114
Last edited:
Може ли да направиш 1 модул за Open Mu Web Clear Inventory (wasntme)

includes/modules.class.php
PHP:
function clear_inv()
{
$character = secure($_POST['character']);
$account = secure($_POST['login']);
$password = secure($_POST['password']);

check_inject();

$queryonline = mssql_query("Select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$onlinecheck = mssql_num_rows($queryonline);

$queryaccount = mssql_query("Select * from MEMB_INFO where memb___id='$account'");
$accountcheck = mssql_num_rows($queryaccount);

$querypassword = mssql_query("Select * from MEMB_INFO where memb___id='$account' and memb__pwd='$password'");
$passwordcheck = mssql_num_rows($querypassword);

$querychar = mssql_query("Select * from Character where Name='$character'");
$charcheck = mssql_num_rows($querychar);

if(empty($character) or empty($account) or empty($password)) { echo"<font color='red'>You cannot leave any fields blank!</font><br>"; $error=1; }
elseif($accountcheck <= 0) { echo"<font color='red'>Your Login does not exist in our database. Please go back and try again!</font><br>"; $error=1; }
elseif($passwordcheck <= 0) { echo"<font color='red'>Your Password does not exist in our database. Please go back and try again!</font><br>"; $error=1; }
elseif($charcheck <= 0) { echo"<font color='red'>Your Character does not exist in our database. Please go back and try again!</font><br>"; $error=1; }
elseif($onlinecheck  >= 1) { echo"<font color='red'>Account $account is online!Please LogOff First!</font><br>"; $error=1;}

if($error != 1) {

echo"<font color='green'>Character $character has been succesfully cleared.</font><br>";

$a = mssql_query("UPDATE Character SET [inventory]=CONVERT(varbinary(1560), null) WHERE Name='$character'");

}
}

И прикачения файл в modules :)
Тествай понеже аз не съм, но се надявам да работи ;)
 

Attachments

  • clear_inv.rar
    486 bytes · Views: 14
  • Like
Reactions: Archon
PHP:
function reset_character()
{
global $resetmoney;
global $resettype;
global $resetpoints;
global $maxresets;
global $resetlevel;

$character = secure($_POST['character']);
$account = secure($_POST['user']);

check_inject();

$query = mssql_query("Select clevel,resets,money,leveluppoint,class from Character where Name='$character'");
$row = mssql_fetch_row($query);

$newmoney = $row[2]-$resetmoney;
$newresets = $row[1] + 1;

$newpoints=$resetpoints * ($row[1] + 1);

$newleveluppoints = $row[3] + $resetpoints;

$queryaccount = mssql_query("Select * from MEMB_INFO where memb___id='$account'");
$accountcheck = mssql_num_rows($queryaccount);

$queryonline = mssql_query("Select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$onlinecheck = mssql_num_rows($queryonline);

$querypassword = mssql_query("Select * from MEMB_INFO where memb___id='$account' and memb__pwd='$password'");
$passwordcheck = mssql_num_rows($querypassword);

$querychar = mssql_query("Select * from Character where Name='$character'");
$charcheck = mssql_num_rows($querychar);


if(empty($character)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Character !</td></tr>"; $error=1; }
elseif($charcheck <= 0) { echo"<font color='red'>Your Character does not exist in our database. Please go back and try again!</font><br>"; $error=1; }
else
{
if($newmoney < 0) { echo"<font color='red'>Character $character dones not have enough money to reset!</font><br>"; $error=1;}
if($row[0] < $resetlevel) { echo"<font color='red'>Character $character must be $resetlevel in order to reset!</font><br>"; $error=1;}
if($newresets > $maxresets) { echo"<font color='red'>Character $character is maximum resets!</font><br>"; $error=1;}
if($onlinecheck  >= 1) { echo"<font color='red'>Account $account is online!Please LogOff First!</font><br>"; $error=1;}

if($error != 1)
{
echo"<td align='center' class='modules'><span class='online'>Character $character has been succesfully restarted.</span></td></tr><br>";

if($resettype == keep)
{
$a = mssql_query("Update Character Set Money='$newmoney',clevel='1',Experience='0',Resets='$newresets' where name='$character'");
}
elseif($resettype == bonus)
{
$a = mssql_query("Update Character Set Money='$newmoney',clevel='1',Experience='0',Resets='$newresets',LevelUpPoint='$newpoints' where name='$character'");
}
elseif($resettype == reset)
{
$a = mssql_query("Update Character Set Strength='25',Dexterity='25',Vitality='25',Energy='25',LeaderShip='25',Money='$newmoney',clevel='1',Experience='0',Resets='$newresets',LevelUpPoint='$newpoints' where name='$character'");
}}}

това е работеща функция за рестарт на героя... всичко е фиксирано, проблема с метода "reset" е оправен !
Важно: Функцията работи само за файлове от Season 3 Ep1 нагоре !!!

в config.php избирате метода за рестарт -> "keep" "reset" "bonus" (nqh)

П.С: Бях намерил грешка и сега съм я отстранил !!! Съжелявам за неудобството !!!!!!!
 
Last edited:
  • Like
Reactions: DEviL_BG and Dea7h
Здравей , видях ,че си направил модул за 3 ти куест на дрейк уеба , искам да те попитам можеш ли да направиш същия , но за Open Mu уеба ? Благодаря Предварително !!


Това ти е функцията и я добавяш в Open web-a в includes/modules.class.php :

PHP:
function tree_quest()
{
$character = secure($_POST['character']);
$account = secure($_POST['login']);
$password = secure($_POST['password']);

check_inject();

$charq = mssql_query("Select class from Character where name='$character'");
$char = mssql_fetch_row($charq);


if($char[0] == 1) {$newclass =  2; }
elseif ($char[0] == 17) {$newclass = 18; }
elseif ($char[0] == 33) {$newclass = 34; }
elseif ($char[0] == 48) {$newclass = 50; }
elseif ($char[0] == 64) {$newclass = 66; }

$queryaccount = mssql_query("Select * from MEMB_INFO where memb___id='$account'");
$accountcheck = mssql_num_rows($queryaccount);

$queryonline = mssql_query("Select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$onlinecheck = mssql_num_rows($queryonline);

$querypassword = mssql_query("Select * from MEMB_INFO where memb___id='$account' and memb__pwd='$password'");
$passwordcheck = mssql_num_rows($querypassword);

$querychar = mssql_query("Select * from Character where Name='$character'");
$charcheck = mssql_num_rows($querychar);

if(empty($character) or empty($account) or empty($password)) { echo"<font color='red'>You cannot leave any fields blank!</font><br>"; $error=1; }
elseif($accountcheck <= 0) { echo"<font color='red'>Your Login does not exist in our database. Please go back and try again!</font><br>"; $error=1; }
elseif($passwordcheck <= 0) { echo"<font color='red'>Your Password does not exist in our database. Please go back and try again!</font><br>"; $error=1; }
elseif($charcheck <= 0) { echo"<font color='red'>Your Character does not exist in our database. Please go back and try again!</font><br>"; $error=1; }
else
{
if($statusr[0] == $character) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character Is Online ! Please Log Off !</td></tr>"; $error=1; }
if($char[0] == 0 or $char[0] == 16 or $char[0] == 32) { echo"<tr><td align='center' class='modules'><b>Error:</b> Before you complete 3rd quest, you need to complete 2nd quest !</td></tr>"; $error=1; }
if($char[0] == 2 or $char[0] == 18 or $char[0] == 34 or $char[0] == 50 or $char[0] == 66) { echo"<tr><td align='center' class='modules'><b>Error:</b> You are completed 3rd quest !</td></tr>"; $error=1; }
if($error != 1)
{
echo"<tr><font color='green'>3rd Quest is completed on character $character !</font></tr>";

$a = mssql_query("Update Character set class='$newclass' where name='$character'");
}}}


Това ти е модула и го запазваш като quest.php в папката на уеб-а, в папка modules :

PHP:
<?php $user = secure($_SESSION['login']);?>
<table border=0 cellspacing=5 cellpadding=0>
<td width='250'>
<form name="" method="post" action="">
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr> 
<td width="70"><font color=#cccccc>Login ID :</td>
<td>
<input name="login" type="text" id="login" maxlength="10">
</td>
</tr>
<tr> 
<td width="70"><font color=#cccccc>Password :</td>
<td><input name="password" type="password" id="password" maxlength="16">
</td>
</tr>
<tr> 
<td width="70"><font color=#cccccc>Character :</td>
<td><input name="character" type="text" id="character" maxlength="16">
</td>
</tr>
</table>

<tr>
<tr>
<td><input type='submit' name='submit' value='Complete Quest'></td>
<td><input type="reset" class=ex name="Submit2" value="Reset"></td>
</tr>
<?php
if(isset($_POST['submit'])) {tree_quest(); } 
?>

</table>
</form>

Дано се справиш по-нататък ! Успех ! :)
 

Attachments

  • quest.rar
    489 bytes · Views: 9
То че може да стане ... може ама не ми се занимава ся...

ПС: Направих го, но не съм го тествал... Пробвай и кажи как е :)

PHP:
function stats_fix() { 

$character = secure($_POST['character']);
$account = secure($_SESSION['user']);
check_inject();

$charq = mssql_query("Select AccountID,leveluppoint,class,Strength,Dexterity,Vitality,Energy,LeaderShip from Character where name='$character'");
$char = mssql_fetch_row($charq);

$UpPoints = $char[1]+$char[3]+$char[4]+$char[5]+$char[6] - 100;
$UpPoints2 = $char[1]+$char[3]+$char[4]+$char[5]+$char[6]+$char[7] - 125;

$statusaq = mssql_query("select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$statusa = mssql_num_rows($statusaq);
if($statusa != 0) { $statusq = mssql_query("select GameIDC From AccountCharacter where Id='$account'"); $statusr = mssql_fetch_row($statusq); }

if(empty($character)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Character !</td></tr>"; $error=1; }
else{
if($statusr[0] == $character) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character Is Online ! Please Log Off !</td></tr>"; $error=1; }
if($char[0] != $account) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please login on system and come back !</td></tr>"; $error=1; }

if($error != 1 and $char[2] != 64 and $char[2] != 66)
{
echo"<tr><td align='center' class='modules'><span class='online'>Points Successfuly fixed and now $character have $UpPoints points to add ! </span></td></tr>";

$a = mssql_query("Update Character set leveluppoint='$UpPoints',Strength='25',Dexterity='25',Vitality='25',Energy='25' where name='$character'");
}
elseif($error != 1 and $char[2] == 64 or $char[2] == 66) {
{
echo"<tr><td align='center' class='modules'><span class='online'>Points Successfuly fixed and now $character have $UpPoints points to add ! </span></td></tr>";

$a = mssql_query("Update Character set leveluppoint='$UpPoints2',Strength='25',Dexterity='25',Vitality='25',Energy='25',LeaderShip='25' where name='$character'");
}}}}
 
Last edited:
Може ли да направиш за X-Project 2010 MuOnline Webs траде онлине време ? като в опенму и инсертму времето което са седяли онлине да могат да си го заменат за кредити пример 1 час 10 кредита.
 
  • Like
Reactions: monaha8
Нaмери ме в скaйп и нaй-вероятно довечерa ще влязa дa ти помогнa :)
 
можеш л ида добавиш и md5 да е он че не мога да регистрирвам ацц-та понеже използвам файлове с md5 on :)
 
където ти е инсерта в таблицата на променливата на паролата ти и сложи мд5($променлива) и готово
 
не ги разбирам грам ако може направи го и ми дай кода и кажи къде да го сложа точно или направо прикачи каквото трябва