[Help] По колко точки да дава

mrrn

New Member
Joined
Oct 17, 2012
Messages
72
Reaction score
26
Да питам според вас по колко точки да дава на Класовете герои при рестарт за да са максимално УРАВНОВЕСЕНИ вер97д ?
 
Имаш ли такъв модул ? ако имаш ми пиши на скайп : sharky_971 да ми го дадеш ако може и ще ти кажа колко точки да сложиш :)
 
Имаш ли такъв модул ? ако имаш ми пиши на скайп : sharky_971 да ми го дадеш ако може и ще ти кажа колко точки да сложиш :)

PHP:
<?php

$query = mssql_query('SELECT Class FROM Character WHERE Name="' . $character_name . '"');
$row = mssql_fetch_row($query);

switch($row[0])
{
	case 0:
	case 1:
		$points_per_reset=900; // dw,sm
		break;
	case 16:
	case 17:
		$points_per_reset=800; // dk,bk
		break;
	case 32:
	case 33:
		$points_per_reset=700; // elf,me
		break;
	case 48:
		$points_per_reset=600; // mg
		break;
	case 64:
		$points_per_reset=500; // dl
		break;
}
 
Last edited:
PHP:
<?php

$query = mssql_query('SELECT Class FROM Character WHERE Name="' . $character_name . '"');
$row = mssql_fetch_row($query);

switch($row[0])
{
	case 0:
	case 1:
		$points_per_reset=900; // dw,sm
		break;
	case 16:
	case 17:
		$points_per_reset=800; // dk,bk
		break;
	case 32:
	case 33:
		$points_per_reset=700; // elf,me
		break;
	case 48:
		$points_per_reset=600; // mg
		break;
	case 64:
		$points_per_reset=500; // dl
		break;
}

Това къде се слага ?
 
При функцията която рестартирва героите.
 
//Web Config
$pkclearmoney = '0'; // PK CLEAR MONEY
$resetlevel = '330'; // RESET LEVEL
$resetpoints = '550'; // RESET POINTS
$resettype = 'reset'; // RESET TYPE keep/bonus/reset
$resetmoney = '0'; // RESET MONEY
$maxresets = '100'; //MAX RESETS
$maxlevel = '350'; // MAX LEVEL
$resetclearinv = 'no'; // ClEAR INVENTORY yes/no
$resetclearskill = 'no'; // CLEAR SKILLS yes/no
$maxstats = '32767'; //MAX STATS

Как да я вкарам по точно ? пробвах като я поставих под тези и нищо не стана :\
 
//Web Config
$pkclearmoney = '0'; // PK CLEAR MONEY
$resetlevel = '330'; // RESET LEVEL
$resetpoints = '550'; // RESET POINTS
$resettype = 'reset'; // RESET TYPE keep/bonus/reset
$resetmoney = '0'; // RESET MONEY
$maxresets = '100'; //MAX RESETS
$maxlevel = '350'; // MAX LEVEL
$resetclearinv = 'no'; // ClEAR INVENTORY yes/no
$resetclearskill = 'no'; // CLEAR SKILLS yes/no
$maxstats = '32767'; //MAX STATS

Как да я вкарам по точно ? пробвах като я поставих под тези и нищо не стана :\
Tова ти е бърза конфигурация. Дай самата функция трябва да е нещо като това:
PHP:
function reset_character(){
blablalbal
}
 
Това?
PHP:
<?
include "../config.php";

$character = secure($_POST['char']);
$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' color='red'><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' color='green'><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'");}
}}
?>
 
Mисля, че трябва да стане така:

PHP:
<? 
include "../config.php"; 

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

check_inject(); 

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

//new
$novaclass = mssql_fetch_array(mssql_query("SELECT Class FROM Character where Name='$character' AccountID='$account'"));
//new

$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; 

//new
if($novaclass == 0 or 1) { $resetpoints = 500;} // Reset points for SM
if($novaclass == 16 or 17) {$resetpoints = 650;} // Reset points for BK
if($novaclass == 32 or 33) {$resetpoints = 480;} // Reset points for Elf
if($novaclass == 48) {$resetpoints = 820;} // Reset points for Magic Gladiator
if($novaclass == 64) {$resetpoints = 920;} // Reset points for Dark Lord
//new

if(empty($character)) { echo"<tr><td align='center' color='red'><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' color='green'><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'");} 
}} 
?>
Поправете ме, ако греша :)
 
  • Like
Reactions: SharkY971
Все още не иска да стане.. дава ми пак по 550 точки( както е посочено от конфиг
файла)

//Web Config
$pkclearmoney = '0'; // PK CLEAR MONEY
$resetlevel = '330'; // RESET LEVEL
$resetpoints = '550'; // RESET POINTS
$resettype = 'reset'; // RESET TYPE keep/bonus/reset
$resetmoney = '0'; // RESET MONEY
$maxresets = '100'; //MAX RESETS
$maxlevel = '350'; // MAX LEVEL
$resetclearinv = 'no'; // ClEAR INVENTORY yes/no
$resetclearskill = 'no'; // CLEAR SKILLS yes/no
$maxstats = '32767'; //MAX STATS
 
Aми изтрий го от там това $resetpoints = '550'; // RESET POINTS
* и в функцията global $resetpoints;
 
  • Like
Reactions: SharkY971
Mисля, че трябва да стане така:

PHP:
<?php
include "../config.php"; 

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

check_inject(); 

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

//new
$novaclass = mssql_fetch_array(mssql_query("SELECT Class FROM Character where Name='$character' AccountID='$account'"));
//new

$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; 

//new
// if($novaclass == 0 or 1)
if($novaclass == 0 or $novaclass == 1) { $resetpoints = 500;} // Reset points for SM
if($novaclass == 16 or $novaclass == 17) {$resetpoints = 650;} // Reset points for BK
if($novaclass == 32 or $novaclass == 33) {$resetpoints = 480;} // Reset points for Elf
if($novaclass == 48) {$resetpoints = 820;} // Reset points for Magic Gladiator
if($novaclass == 64) {$resetpoints = 920;} // Reset points for Dark Lord
//new

if(empty($character)) { echo"<tr><td align='center' color='red'><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' color='green'><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'");} 
}} 
?>
Поправете ме, ако греша :)

имаш грешка в кода
 
Code:
//new
$novaclass = mssql_fetch_array(mssql_query("SELECT Class FROM Character where Name='$character' AccountID='$account'"));
//new
трябва да е
Code:
//new
$novaclass = mssql_fetch_array(mssql_query("SELECT Class FROM Character where Name='$character' [COLOR="Red"]and[/COLOR]  AccountID='$account'"));
//new
на пръв поглед това ми направи впечатление
 
Code:
//new
$novaclass = mssql_fetch_array(mssql_query("SELECT Class FROM Character where Name='$character' AccountID='$account'"));
//new
трябва да е
Code:
//new
$novaclass = mssql_fetch_array(mssql_query("SELECT Class FROM Character where Name='$character' [COLOR="Red"]and[/COLOR]  AccountID='$account'"));
//new
на пръв поглед това ми направи впечатление
Не знам.. При мен работи и без "and".
 
Aми изтрий го от там това $resetpoints = '550'; // RESET POINTS
* и в функцията global $resetpoints;

След като ги изтрия не дава никакви точки ?
 
Твоя скрипт + примера на MeMoS:

PHP:
<?php
include "../config.php";

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

check_inject();

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

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

switch($char[4])
{
    case 0:
    case 1:
        $resetpoints=900; // dw,sm
        break;
    case 16:
    case 17:
        $resetpoints=800; // dk,bk
        break;
    case 32:
    case 33:
        $resetpoints=700; // elf,me
        break;
    case 48:
        $resetpoints=600; // mg
        break;
    case 64:
        $resetpoints=500; // dl
        break;
}

$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' color='red'><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' color='green'><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'");}
}}
?>
 
  • Like
Reactions: SharkY971
<?php code ?>

Някой ще реши да го ползва и ще му изгърми без да разбере и пак ще има реторични въпроси ;д
 
Някой спешно да ми вкара скрипта за точките в този скрипт моля! :)

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'");}
}}}

Едит: Оправих се .
 
Last edited: