avatar_DJGRAD

Помощь в переписывании скрипта Mu Online на Dark Style 4.4.1

Автор DJGRAD, 2010 Сен. 06, 23:37

« назад - далее »

0 Пользователи и 1 гость просматривают эту тему.

Ключевые слова [SEO] mu onlineскриптпереписать

DJGRAD

Помогите пожалуйста Переписать скрипт с Mu Web 0.7 на Dark Style 4.4.1
Этот скрипт Grand Reset
Вот скрипт :

<?php

function _gr(){
global 
$GR;
$GR["level"] = 400// need lvl, 0 - any lvl O_o
$GR["money"] = 100000000// money need for each gr, if you set below zero then users will get this money(zen). 0 - nothing
$GR["resets"] = 100// resets need for each gr, 0 - any resets
$GR["credits"] = -1000// Above zero - users paying credits, below zero - get for gr. 0 - nothing
$GR["resets_reset"] = FALSE// CLEAN OR NO ( TRUE OR FALSE )
$GR["inventory"] = TRUE// Clean inventory YES or NO ( TRUE or FALSE )
$GR["stats_reset"] = TRUE// Reset or NO stats(points, TRUE or FALSE)
$GR["mode"] = "LO"// GR mode. "LO" or "HI" - LOW or HIGH
}



if( 
$_SESSION["set_lang"] == "Russian" )
set_rus();
else 
set_eng();

// Default Stats (after GR)
$GR_DS = array(2825102835);
//              str dex vit ene cmd

echo "<center> <a><b>Grand Reset</b></a> <br>";



//Data Capture
$account clean_var(stripslashes($login));
$query                    mssql_query("exec XCredits '".$account."',0;");
$char_info mssql_query("SELECT AccountID ,Money, cLevel, Reset, gr_count FROM Character WHERE Name='"$char_set ."'");
$char_info mssql_fetch_array($char_info);

$credits_ mssql_query("SELECT credits FROM MEMB_CREDITS WHERE memb___id='"$char_info["AccountID"] ."'");
if( 
mssql_num_rows($credits_) != )
$credits[0] = 0;
else 
$credits mssql_fetch_row($credits_);
////
_gr();
NEED_SET();


if( isset( 
$_POST["gr_button"] ) )
do_gr($char_set);

_gr();
NEED_SET();

?>

<br>
<table class="sort-table" border="0" cellpadding="0" cellspacing="0">
<thead><tr>
<td colspan="2" align="center">
<?=mmw_lang_need?>
</td>
</tr></thead>
<? if( $GR["level"] > 0 ) { ?>
<tr>
<td align="right"><?=ucfirst(mmw_lang_level)?></td>
<td align="left">
<?=($char_info["cLevel"] >= $GR["level"]) ? "ok" : mmw_lang_more ." ". ($GR["level"] - $char_info["cLevel"])?>
</td>
</tr>
<? }
if( $GR["money"] > 0 ) { ?>
<tr>
<td align="right"><?=ucfirst(mmw_lang_money)?></td>
<td align="left"> <?=$m_need?>
</td>
</tr>
<? }
if( $GR["resets"] > 0 ) { ?>
<tr>
<td align="right"> Resets </td>
<td align="left"> <?=$res_need?>
</td>
</tr>
<? } if( $GR["credits"] > 0 ) {?>
<tr>
<td align="right"><?=ucfirst(mmw_lang_credits_)?></td>
<td align="left"><?=$cr_need?>
</td>
</tr>
<? } ?>
<tr>
<td colspan="2" align="right">
<center>
<form action="" method="POST" name="gr_form">
<input type="submit" value=" <?=mmw_lang_try?> " name="gr_button">
</form>
</center>
</td>
</tr>

</table>
<br>
<a><b><?=mmw_lang_requirements?></b></a><br>
<?
if( $GR["money"] > 0 )
echo "<a>". mmw_lang_need_money_t . $GR["money"] ."</a><br>";
else if( $GR["money"] < 0 )
echo "<a>". mmw_lang_gift ."- ". -$GR["money"] ." ". mmw_lang_zen ."</a><br>";
if( $GR["credits"] > 0 )
echo "<a>". mmw_lang_need_credits_t . $GR["credits"] ."</a><br>";
else if( $GR["credits"] < 0 )
echo "<a>". mmw_lang_gift ."- ". -$GR["credits"] ." ". mmw_lang_credits__ ."</a><br>";
?>
<a><?=mmw_lang_need_level_t . $GR["level"] ?></a><br>
<a><?=mmw_lang_need_resets_t . $GR["resets"] ?></a><br><br>
<a><?=$char_set ." - ". $char_info[4] ." [GR]" ?></a><br>
</center>
<?

function do_gr($char_set){
global $GR, $GR_DS, $okey_start, $okey_end, $die_start, $die_end, $char_info, $credits, $GR_T;

$error = FALSE;

if( !isset($char_set) || !$char_set ){
echo "You havent a character";
return -1;
}

if( $GR_T["resets_need"] > 0) {
echo $die_start . ucfirst(mmw_lang_need) ." ". mmw_lang_more ." ". $GR_T["resets_need"] .
" resets". $die_end;
$error = TRUE;
}
if( $char_info["cLevel"] < $GR["level"] ) {
echo $die_start . ucfirst(mmw_lang_need) ." ". mmw_lang_more ." ". ($GR["level"] - $char_info["cLevel"]) .
" lvls". $die_end;
$error = TRUE;
}
if( $GR_T["money_need"] > 0) {
echo $die_start . ucfirst(mmw_lang_need) ." ". mmw_lang_more ." ". $GR_T["money_need"] .
" ". mmw_lang_zen . $die_end;
$error = TRUE;
}
if( $status > 0 ) {
echo $die_start . mmw_lang_login_off . $die_end;
$error = TRUE;
}
if( $GR_T["credits_need"] > 0) {
echo $die_start . mmw_lang_more ." ". $GR_T["credits_need"] . mmw_lang_credits__ . $die_end;
$error = TRUE;
}
if( $_SESSION["user"] != $char_info["AccountID"] ) {
$error = TRUE;
echo "What?!?<br>";
}
if( $error ) return -1;
///////
///////
if( $GR["inventory"] )
$cln_inv = ", [inventory]=CONVERT(varbinary(1080), null)";
else $cln_inv = NULL;

if( $GR["stats_reset"] )
$cln_stat = ", [Strength]='". $GR_DS[0] ."',
[Dexterity]='". $GR_DS[1] ."',
[Vitality]='". $GR_DS[2] ."',
[Energy]='". $GR_DS[3] ."',
[Leadership]='". $GR_DS[4] ."'";
else  $cln_stat = "";

if( $GR["resets_reset"] )
$cln_res = ", [Reset] = '0'";
else $cln_res = "";

$Q1 = "UPDATE Character SET  [cLevel]='1', [Experience]='0' $cln_inv $cln_stat $cln_res, [Money]='". -$GR_T["money_need"] ."',
[gr_count]=[gr_count]+1
WHERE [Name] = '". $char_set ."' ";

$char_info[4] += 1;


mssql_query($Q1);

if( $GR["credits"] < 0 )
mssql_query("UPDATE MEMB_CREDITS SET [credits] = [credits] + '". -$GR["credits"] ."' WHERE [memb___id] = '". $char_info["AccountID"] ."'");
elseif( $GR["credits"] > 0 )
mssql_query("UPDATE MEMB_CREDITS SET [credits] = [credits] - '". $GR["credits"] ."' WHERE [memb___id] = '". $char_info["AccountID"] ."'");

echo $okey_start . mmw_lang_complete . $okey_end;
return 0;
}

function NEED_SET(){
global $GR, $GR_T, $char_info, $credits, $res_need, $m_need, $cr_need;

if( ( $GR["mode"] == "LO" && $GR["resets_reset"] == FALSE ) ||
($GR["resets_reset"] == TRUE && $GR["mode"] == "LO" ) ){

$GR_T["resets_need"] = $GR["resets"] - ( $char_info["Reset"] - $GR["resets"]*$char_info[4] );

if( $GR["resets_reset"] == TRUE && $GR["mode"] == "LO" )
$GR_T["resets_need"] -=  $GR["resets"]*$char_info[4];
else
$GR["resets"] *= $char_info[4]+1;
}

if( $GR["mode"] == "HI" && $GR["resets_reset"] == TRUE )
$GR["resets"] *= $char_info[4] + 1;
$GR_T["resets_need"] = $GR["resets"] - $char_info["Reset"];

if( $GR["mode"] == "HI" && $GR["resets_reset"] == FALSE ) {
$error = TRUE;
echo "RESET SETTINS ERROR!<br> Please Contact Administrator";
exit();
}
if( $GR["mode"] == "HI" ) {
$GR["money"] *= $char_info[4] + 1;
$GR["credits"] *= $char_info[4] + 1;
}
$GR_T["money_need"] = $GR["money"] - $char_info["Money"];
$GR_T["credits_need"] = $GR["credits"] - $credits[0];
if( $GR_T["resets_need"] <= 0)
$res_need = "ok";
else
$res_need = mmw_lang_more ." ". $GR_T["resets_need"];

if( $GR_T["money_need"] <= 0)
$m_need = "ok";
else
$m_need = mmw_lang_more ." ". $GR_T["money_need"];

if( $GR_T["credits_need"] <= 0)
$cr_need = "ok";
else
$cr_need = mmw_lang_more ." ". $GR_T["credits_need"];
}

// a1 = b - ( r - b*g); LOW && FALSE
// a2 = b - r; LOW TRUE
// a3 = b*(b+1) - r; HI TRUE

// a2 = b - ( r - bg) - bg

function set_rus(){
define("mmw_lang_credits_", "Кредитов");
define("mmw_lang_more", "еще");
define("mmw_lang_money", "Деньги");
define("mmw_lang_try", "Grand Reset");
define("mmw_lang_complete", "Готово!");
define("mmw_lang_zen", "Zen");
define("mmw_lang_need_money_t", "Необходимо Zen - ");
define("mmw_lang_need_resets_t", "Необходимо ресетов - ");
define("mmw_lang_need_level_t", "Необходим уровень - ");
define("mmw_lang_gift", "В подарок ");
define("mmw_lang_need_credits_t", "Необходимо кредитов - ");
define("mmw_lang_requirements", "Требования");
define("mmw_lang_credits__", " кредитов");

}

function set_eng(){
define("mmw_lang_credits_", "Credits");
define("mmw_lang_more", "more");
define("mmw_lang_money", "Money");
define("mmw_lang_try", "Grand reset");
define("mmw_lang_complete", "Completed!");
define("mmw_lang_zen", "Zen");
define("mmw_lang_need_money_t", "Need Zen - ");
define("mmw_lang_need_resets_t", "Need resets - ");
define("mmw_lang_need_level_t", "Need level - ");
define("mmw_lang_gift", "Gift ");
define("mmw_lang_need_credits_t", "Need Credits - ");
define("mmw_lang_requirements", "Requirements");
define("mmw_lang_credits__", " Credits");
}

?>


Зарание спасибо

Похожие темы (5)