[Tutorial]CabalToolz 2.0,3.0 Reset System

    Distribuiţi
    avatar
    ReLaX
    Administrator
    Administrator

    masculin Balanta Capra
    Mesaje : 247
    Puncte : 1136
    Reputatie : 0
    Data de inscriere : 11/04/2010
    Varsta : 26
    Localizare : Lupeni
    Joburi/Distractii : Cluburi,Scoala vb vine fac la grup,Sex
    Stare de spirit : Fresh...Duc Life

    [Tutorial]CabalToolz 2.0,3.0 Reset System

    Mesaj  ReLaX la data de Dum Mar 27, 2011 8:57 am

    1.Deschide Query Analyzer

    2.Selecteaza GAMEDB database

    3.Adauga acest script:
    Cod:
    ALTER TABLE [dbo].[cabal_character_table]
    ADD
     [Reset] [int] NULL DEFAULT (0)
    4.Mergeti in webserver directory\backend

    Exemplu:C:\xampp\htdocs\backend
    "backend" este CabalToolz Backend

    5.Creati un fisier php si numitil resets.php

    6.Deschideti resets.php din folderul backend

    Exemplu:C:\xampp\htdocs\backend\resets.php
    7.Adaugati acest script
    Cod:
        <? include 'config.php'; ?><?
        $db=mssql_connect($addr,$user,$pass);

        mssql_select_db("ACCOUNT", $db);
        $sql = "SELECT COUNT(*) FROM cabal_auth_table";
        $res = mssql_query($sql);
        $row = mssql_fetch_row($res);
        $count1=$row[0];

        mssql_select_db("Gamedb", $db);

        $sql = "SELECT * FROM cabal_character_table WHERE Login='1'";
        $res = mssql_query($sql);
        $count=0;
        while($row = mssql_fetch_array($res)){
        $count++;
        }

        $sql = "SELECT COUNT(*) FROM cabal_character_table";
        $res = mssql_query($sql);
        $row_count = mssql_fetch_row($res);


        $sql = "SELECT * FROM cabal_character_table ORDER BY RESET";
        $res = mssql_query($sql);
        $i=0;
        while($row = mssql_fetch_array($res)){
        $data[$i] = $row['Name'];
        $data1[$i]= $row['RESET'];
        //print '<b>'.$row_count[0].$data[$i]."</b><br>";

        if($i==$row_count[NULL])break;
        $i++;
        }


        ?> <center>
        <table width="525" border="0" align="left" cellpadding="0" cellspacing="0">
          <tr>
            <td width="21"><font size="3" face="Arial"><img src="_img/centro1.gif" width="28" height="30"></font></td>
            <td width="484" background="_img/centro2.gif"><font size="3" face="Arial"><strong>  <font color="#000000" size="2">Ranking
                    Reset
                    - </font></strong></font><font face="Arial"><strong><? echo $svname ?></strong></font></td>
            <td width="20"><font size="3" face="Arial"><img src="_img/centro3.gif" width="19" height="30"></font></td>
          </tr>
        </table>
        <div align="center"><br>
            <br>
            <br>
            <?if(isset($_SESSION['user'])){
        echo "<center><b>".htmlspecialchars($_SESSION['user'])."</b></center>";

        }
        ?>
        </div>
        </center>

          <div align="center">
            <table width='200' border='0' cellspacing='0' cellpadding='0' class='3'>
              <tr>
                <td width="100%" align='center' class='3'><p align="left"><font color="#CCCCCC" size="2" face="Arial, Helvetica, sans-serif"><b>Character</b></font></p>       
                </td>
                <td width="90%" height="19" colspan="3" align='center' class='3'>          <p align="center"><font color="#CCCCCC" size="2" face="Arial, Helvetica, sans-serif"><b>Reset</b></font></p>       
                </td>
              </tr>
          <?
        $k=0;
        for($i=$row_count[0];$i>=0;$i--){
        if(!isset($data[$i])){}else{
        $k++;
        if($k>=10){}else{
        ?>    <tr>
                <td align='left' class='3'><font color="#333333" size="2" face="Arial"><?echo '<b>'.$data[$i];?></font></td>
                <td height="19" colspan="3" align='center' class='3'><font color="#333333" size="2" face="Arial"><? echo '<b>'.$data1[$i].'</b>';?></font></td>
              </tr>
          <?

        }
        }
        }
        ?>
            </table>
          </div>

    PS:Daca aveti deja resets.php , nu va ingrijorati , deschidetil , stergeti tot ce este scris in el si adaugati codul de mai sus.

    8.Save & Close

    9.Mergeti in backend\modules

    Exemplu:C:\xampp\htdocs\backend\modules

    10.Deschideti user.resets.php

    11.Stergeti tot ce este in el

    12.Aadaugati acest script
    Cod:
    <?PHP
    if (!isset($_config)) die('Ops!');

            $rs = $db2->Execute('Select Lev,Style, Alz, STR, DEX, INT, PNT, RESET, characteridx,  Name from cabal_character_table where characteridx = ? ', array($this->id));
                $char = $rs->GetArray();
                $rs = $char[0];
                $style = decode_style($rs['Style']);
    if ($style['Class'] > 8) $style['Class'] = $style['Class']-8;
    if ($rs[$_config['ucp_lvl_col']] == null) $rs[$_config['ucp_lvl_col']] = 0;
    $rs2 = $db->Execute('select * from cabal_newchardata_table where classtype=? and lev = 1 and DataIdx=10',array($style['Class']));
    $char = $rs2->GetArray();
    $rs2 = $char[0]; 
            $msg2 = char_list($this->id); 
                if (online_check($db2,$this->id) == false && isset($rs['Lev'])) {
                    if ($_config['ucp_lvl_allow'] == true ) {
                      if ($rs['Lev']  >= $_config['ucp_lvl_level']) {
                        if ($rs['Alz'] >= $_config['ucp_lvl_payment']) {
                            if ( $_config['ucp_lvl_inv_check'] == false) {
                              if ($rs[$_config['ucp_lvl_col']] < $_config['ucp_lvl_limit'] ) {
                                      writelog("[ $name ] Level Reset","Level Reset");
    if ($_config['ucp_lvl_keep_stat'] == true) {

    $form .= '<table width="100%" cellpadding="5"><tr>';
    $form .= '<td><fieldset><legend>Before</legend>
    <label>Level:</label> '.$rs['LEV'].'<br/>
    <label>STR:</label> '.$rs['STR'].'<br/>
    <label>DEX:</label> '.$rs['DEX'].'<br/>
    <label>INT:</label> '.$rs['INT'].'<br/>
    <label>PNT:</label> '.$rs['PNT'].'<br/>
    <label>'.$_config['ucp_lvl_col'].':</label> '.$rs[$_config['ucp_lvl_col']].'<br/>
    </fieldset></td>';
    $form .= '<td><fieldset><legend>After</legend>
    <label>Level:</label> 1<br/>
    <label>STR:</label> '.$rs['STR'].'<br/>
    <label>DEX:</label> '.$rs['DEX'].'<br/>
    <label>INT:</label> '.$rs['INT'].'<br/>
    <label>PNT:</label> '.($rs['PNT']+$_config['ucp_lvl_bonus']).'<br/>
    <label>'.$_config['ucp_lvl_col'].':</label> '.($rs[$_config['ucp_lvl_col']]+1).'<br/></fieldset></td>';
    $form .= '</tr></table>';
    if ($this->opt1 == 'do_reset'){// && ctype_digit($rs2['LEV'])) {
    alert('You are now being reseted, Press OK to confirm');
    $temp = $rs['RESET'] + 1; 
    $do = $db2->Execute('update cabal_character_table set LEV=?,PNT=?,EXP=0,WorldIdx=?,Position=?,Nation=0,Alz=?,'.$_config['ucp_lvl_col'].'=? where CharacterIdx = ? and Lev >= ?',
     array($rs2['LEV'], ($rs['PNT']+$_config['ucp_lvl_bonus']),$rs2['WorldIdx'],$rs2['Position'],($rs['Alz']-$_config['ucp_lvl_payment']),($temp),$this->id,$_config['ucp_lvl_level']));
    }


      } else {
    $form .= '<table width="100%" cellpadding="5"><tr>';
    $form .= '<td><fieldset><legend>Before</legend>
    <label>Level:</label> '.$rs['LEV'].'<br/>
    <label>STR:</label> '.$rs['STR'].'<br/>
    <label>DEX:</label> '.$rs['DEX'].'<br/>
    <label>INT:</label> '.$rs['INT'].'<br/>
    <label>PNT:</label> '.$rs['PNT'].'<br/>
    <label>'.$_config['ucp_lvl_col'].':</label> '.$rs[$_config['ucp_lvl_col']].'<br/>
    </fieldset></td>';
    $bonus = (($rs[$_config['ucp_lvl_col']]+1) * 10) +$_config['ucp_lvl_bonus'];
    $form .= '<td><fieldset><legend>After</legend>
    <label>Level:</label> '.$rs2['LEV'].'<br/>
    <label>STR:</label> '.$rs2['STR'].'<br/>
    <label>DEX:</label> '.$rs2['DEX'].'<br/>
    <label>INT:</label> '.$rs2['INT'].'<br/>
    <label>PNT:</label> <b>'.$bonus.'</b><br/>
    <label>'.$_config['ucp_lvl_col'].':</label> '.($rs[$_config['ucp_lvl_col']]+1).'<br/></fieldset></td>';
    $form .= '</tr></table>';

    if ($this->opt1 == 'do_reset'){ //&& ctype_digit($rs2['LEV'])) {
    alert('You are now being reseted, Press OK to confirm');
    $temp = $rs['RESET'] + 1; 
    //$db2->debug=1;

    $do = $db2->Execute('update cabal_character_table set LEV=?,STR=?,DEX=?,INT=?,PNT=?,EXP=0,WorldIdx=?,Position=?,HP=?,MP=?,Nation=0,Alz=?,'.$_config['ucp_lvl_col'].'=? where CharacterIdx = ? and Lev >= ?',
     array($rs2['LEV'], $rs2['STR'], $rs2['DEX'], $rs2['INT'],($bonus),$rs2['WorldIdx'],$rs2['Position'],$rs2['HP'],$rs2['MP'],($rs['Alz']-$_config['ucp_lvl_payment']),($temp),$this->id,$_config['ucp_lvl_level']));
    }           
        }     

           
    $form .= '<center><input type="button" value="Click Here to Reset Your Hero" onclick="javascript:this.disabled=1;char_do(\''.$this->id.'\',\'Reset\',\'do_reset\');"></center>';
                                    //if ($_config['lvl_magic_clear'] == true) $db->Execute('update Character  SET MagicList = Null where and mu_id = ?', array($this->id));
                              } else $msg = _Reset_limit.' ('.$_config['ucp_lvl_limit'].')';
                            } else $msg = _Reset_inv.' <a href="javascript:char_do('.$this->id.',\'cls_inv\');"> CLEAR INVENTORY! </a>';
                        } else $msg = _Reset_money_r;
                      } else $msg = _Reset_lvl_r;
                  } else $msg = _Reset_not_allowed;
                } else $msg = _Reset_online;


                $msg .= '<br><br><center><a href="javascript:form_read(\'Hero\')"><img border=0 src="includes/back.png"><br>'._Back_Hero.'</a></center>';
               
                $msg2 .= '<hr> Inventory Empty Check: '.($_config['ucp_lvl_inv_check'] == false ? 'No check' : 'Needed' ).'
                <br> Money in Hand: '.$rs['Alz'].' <br> Money Needed for Reset: '. ($_config['ucp_lvl_payment']).' <hr><b> '.$msg .'</b>';
                aprint('tabs-content', $form .$msg2);
    ?>

    13.Save & Close

    14.Mergeti in backend\config.php

    Exemplu:C:\xampp\htdocs\backend\config.php

    15.Si cautati urmatoarele linii
    Cod:
    // LEvel Reset config
    $_config['ucp_lvl_allow'] = false; // true of false
    $_config['ucp_lvl_level'] = 200;
    $_config['ucp_lvl_payment'] = 100000000;
    $_config['ucp_lvl_inv_check'] = true; // if true will check if inventory and equipments are empty
    $_config['ucp_lvl_keep_stat'] = false; // if true keep stats is enabled
    $_config['ucp_lvl_bonus'] = 75; // Bonus per reset
    $_config['ucp_lvl_magic_clear'] = false; // if true will remove magic list
    $_config['ucp_lvl_limit'] = 999; // Limit number for resets
    $_config['ucp_lvl_col'] = 'RESETS'; // name of the column

    16.Inlocuitile cu:
    Cod:
        // LEvel Reset config
        $_config['ucp_lvl_allow'] = true; // true or false
        $_config['ucp_lvl_level'] = 200;
        $_config['ucp_lvl_payment'] = 10000000;
        $_config['ucp_lvl_inv_check'] = false; // this have to be false if true it's not working
        $_config['ucp_lvl_keep_stat'] = true; // if true keep stats is enabled
        $_config['ucp_lvl_bonus'] = 5; // Bonus per reset
        $_config['ucp_lvl_magic_clear'] = false; // if true will remove magic list
        $_config['ucp_lvl_limit'] = 500; // Limit number for resets
        $_config['ucp_lvl_col'] = 'Reset'; // name of the column

    17.Configuratil cum vreti sa fie sistemul de reset

    18.Save & Close.
    Done acum aveti reset system in UserPanel!

    Credits:
    john_d for scripts.
    rElAx!Update for tutorial.

      Acum este: Joi Iul 19, 2018 11:34 am