How to add Grand Reset System to your muweb site

Results 1 to 16 of 16
  1. #1
    Novice jokerady is offline
    MemberRank
    May 2011 Join Date
    4Posts

    idea How to add Grand Reset System to your muweb site

    Hi all,

    This is the code i've added to my muweb 0.9 Premium, that has php clear code(not using that cipher function).
    It simply ads a Grand Reset page where players can grand reset themselves, so they do not bother administrators all the time.
    I've tested it and worked with no problems for me.
    Here is what u must do:

    open file website_ROOT\sub_pages\Characters.php

    find:
    Code:
    <li><a href="'.$muweb['servername'].'-Characters-Info.html">'._Characters_Info.'</a></li>
    after this line add:
    Code:
    <li><a href="'.$muweb['servername'].'-Characters-GrandReset.html">GrandReset</a> <span style="color:red;"> New</span></li>
    then find:
    Code:
    case "AddStats":
    BEFORE THIS LINE ADD:

    PHP Code:

                        
    //GR SYSTEM                    
                        
    case "GrandReset":
                            
    $grdb=mssql_connect('localhost''SQL_USERNAME''SQL_PASSWORD') or die('error');
                            @
    mssql_select_db('MuOnline') or die('error');
                            
    $GRquery="SELECT Name FROM Character WHERE AccountID='".$_SESSION['user_login_name']."' AND resets>=100";
                            
    $GRdata=mssql_query($GRquery);

                            if (
    $_POST['Char']!="")
                            {
                                
    $GRquery="SELECT * FROM Character WHERE AccountID='".$_SESSION['user_login_name']."' AND name='".$_POST['Char']."'";
                                
    $GRdata=mssql_query($GRquery);
                                
    $GRrow mssql_fetch_array($GRdata);
                                if (
    $GRrow['Resets']>=100)
                                {
                                    if (
    $GRrow['Resets']>100)
                                    {
                                        
    $GRr=$GRrow['Resets']-100;
                                        
    $GRpts=intval(25+10000+2000*$GRr); //10000 is the 10k points left that the character will have after GR
                                        
    $GRquery="Update Character SET [Resets]='0',[LevelUpPoint]='".$GRpts."',[strength]='25',[dexterity]='25',[vitality]='25',[energy]='25' WHERE AccountID='".$_SESSION['user_login_name']."' AND name='".$_POST['Char']."'";
                                    }
                                    else
                                    {
                                        
    $GRquery="Update Character SET [Resets]='0',[LevelUpPoint]='10000',[strength]='25',[dexterity]='25',[vitality]='25',[energy]='25' WHERE AccountID='".$_SESSION['user_login_name']."' AND name='".$_POST['Char']."'"//10000 is the 10k points left that the character will have after GR
                                    
    }
                                    @
    mssql_query($GRquery) or die('Error While Trying to Stats Reset! <br/>'.mssql_get_last_message());
                                    
    //--
                                    
    $crquery="Select * FROM MEMB_CREDITS WHERE memb___id='".$_SESSION['user_login_name']."'";
                                    
    $crdata=mssql_query($crquery);
                                    
    $crrow mssql_fetch_array($crdata);
                                    
    $GRcredits=$crrow['credits'];
                                    
    //--
                                    
    $GRcredits=$GRcredits+1000//1000 is the credits reward
                                    
    $GRquery="Update MEMB_CREDITS SET [credits]='$GRcredits' WHERE memb___id='".$_SESSION['user_login_name']."'";
                                    @
    mssql_query($GRquery) or die('Error While Trying to Add WebShop Credits! <br/>'.mssql_get_last_message());
                                    echo 
    'Character '.$_POST['Char'].' was successfully GrandReseted!<br/>';
                                    echo 
    'Credits were added to your WebShop Account!';
                                }
                            }
                            else
                            {
                                echo 
    '
                                <script type="text/javascript">
                                function get_radio_value()
                                {
                                for (var i=0; i < document.myform.Char.length; i++)
                                   {
                                   if (document.myform.Char[i].checked)
                                      {
                                      rad_val = document.myform.Char[i].value;
                                      alert("Character Selected: "+rad_val+"  Will Be Grand Reseted! :)");
                                      return true;
                                      }
                                   }
                                }
                                </script>
                                '
    ;
                                echo 
    '<form name="myform" action="AvengerSMu-Characters-GrandReset.html" method="POST">';
                                
    $GRchars=0;
                                do {
                                    while (
    $row mssql_fetch_row($GRdata)) {
                                        echo (
    '<input type="radio" name="Char" value="'.$row[0].'"> '.$row[0].'<br> ');
                                        
    $GRchars $GRchars +1;
                                    }
                                } while (
    mssql_next_result($GRdata));
                                echo 
    '<input type="submit" value="Submit" onClick="return get_radio_value();"/></form>';
                                if (
    $GRchars == 0)
                                {
                                    echo 
    "No Character over 100 RR found !";
                                }
                            }                        
                        break;
                        
    //END OF GR SYSTEM 
    Now it is configured to enable GR at 100RR with 1000 credits reward.

    It also reset stats to 25 points and adds 10k point to add.

    Feel free to post here if you need extra explanations or 2 get helo to reconfigure the code in order to meet your requirements!

    Hope it helps !
    Last edited by jokerady; 06-09-11 at 01:39 AM.


  2. #2
    Novice Reba7x is offline
    MemberRank
    Nov 2011 Join Date
    2Posts

    Re: How to add Grand Reset System to your muweb site

    well is it possible to make it a 5 resets for the grand reset? and 65400 on all stats instead of back to 25?

  3. #3
    Developer ETTETT is offline
    MemberRank
    May 2007 Join Date
    RukongaiLocation
    662Posts

    Re: How to add Grand Reset System to your muweb site

    I'm sure it is possible. It just requires a bit fixing :)

  4. #4
    Account Upgraded | Title Enabled! micah1121 is offline
    MemberRank
    Jan 2010 Join Date
    213Posts

    Re: How to add Grand Reset System to your muweb site

    nice, works perfectly fine for me, thanks a bunch :p

  5. #5
    Apprentice laFk is offline
    MemberRank
    Feb 2009 Join Date
    23Posts

    Re: How to add Grand Reset System to your muweb site

    When in website press GrandReset New , just showing ERROR

    edit - Sorry , all is working ty!

    Who to get in Ranking , top5 to shows GrandResets?
    Last edited by laFk; 01-01-12 at 09:31 PM. Reason: Sor

  6. #6
    Enthusiast destroed is offline
    MemberRank
    Mar 2009 Join Date
    30Posts

    Re: How to add Grand Reset System to your muweb site

    Yes, I have the same, how to make GrandReset showing on Rankings?

  7. #7
    Enthusiast wow5656 is offline
    MemberRank
    Apr 2009 Join Date
    43Posts

    Re: How to add Grand Reset System to your muweb site

    Nice, thx

  8. #8
    Am i? ScriptKid is offline
    MemberRank
    Oct 2006 Join Date
    $Location="??";Location
    1,810Posts

    Re: How to add Grand Reset System to your muweb site

    learn the PHP thing :P
    Posted via Mobile Device

  9. #9
    Novice nemosad is offline
    MemberRank
    Feb 2012 Join Date
    1Posts

    Re: How to add Grand Reset System to your muweb site

    Quote Originally Posted by laFk View Post
    When in website press GrandReset New , just showing ERROR

    edit - Sorry , all is working ty!

    Who to get in Ranking , top5 to shows GrandResets?
    Hello can you tell me how you got it to work.? i get error

  10. #10
    Tech ®estless RSLocs is offline
    MemberRank
    Nov 2009 Join Date
    Cahir, IrelandLocation
    264Posts

    Re: How to add Grand Reset System to your muweb site

    Yeah i get error too...

    Can someone post with more detail on adding the PHP line. Because thats where i get the error...

    edit - Ok I got it to work but the grand Reset count is not adding to my Ranking Can anyone tell me how to get it to add?
    Last edited by RSLocs; 28-04-12 at 05:02 PM.

  11. #11
    Novice rincis991 is offline
    MemberRank
    May 2012 Join Date
    Leicester, UnitLocation
    3Posts

    Re: How to add Grand Reset System to your muweb site

    Quote Originally Posted by nemosad View Post
    Hello can you tell me how you got it to work.? i get error
    Same here. Can someone help with this?

  12. #12
    Member andulinu is offline
    MemberRank
    Oct 2007 Join Date
    RomaniaLocation
    58Posts

    Re: How to add Grand Reset System to your muweb site

    Quote Originally Posted by 4ufo89 View Post
    Yeah i get error too...

    Can someone post with more detail on adding the PHP line. Because thats where i get the error...

    edit - Ok I got it to work but the grand Reset count is not adding to my Ranking Can anyone tell me how to get it to add?
    same problem with count if somebody will have the pleasure to change a little bit the script to update in Characters table the GrandRes collum to show in rankings , it`s same like Reset script
    UPDATE Characters
    SET GrandRes='+1' bla bla but i am noob on php.

  13. #13
    Apprentice Phenomenw is offline
    MemberRank
    Nov 2011 Join Date
    12Posts

    Re: How to add Grand Reset System to your muweb site


  14. #14
    Novice cepums53 is offline
    MemberRank
    Nov 2013 Join Date
    1Posts

    Re: How to add Grand Reset System to your muweb site

    Hello all i dont understand </tr></tbody>'; } $res_con .='</table><br>'; } brea;ALL PHP cood need put here?? case "AddStats": if(read_module(32) == 0){ echo locked('For the moment this page is closed...Please try again latter.','370'); }else{ if(isset($_GET['op3']) && check_c($_GET['op3'],$_SESSION['user_login_name']) == true){ if(isset($_POST['add'])){ $lvlup = clean_variable($_POST['str']) + clean_variable($_POST['agi']) + clean_va
    pleas help :)

  15. #15
    Account Upgraded | Title Enabled! susanu is offline
    MemberRank
    Jan 2012 Join Date
    235Posts

    Re: How to add Grand Reset System to your muweb site

    Quote Originally Posted by Phenomenw View Post
    error me two and addstats is offine now .

  16. #16
    Account Upgraded | Title Enabled! susanu is offline
    MemberRank
    Jan 2012 Join Date
    235Posts

    Re: How to add Grand Reset System to your muweb site

    where to put this code >>
    Code:
                        //GR SYSTEM                     
                        case "GrandReset": 
                            $grdb=mssql_connect('localhost', 'SQL_USERNAME', 'SQL_PASSWORD') or die('error'); 
                            @MSSql_select_db('MuOnline') or die('error'); 
                            $GRquery="SELECT Name FROM Character WHERE AccountID='".$_SESSION['user_login_name']."' AND resets>=100"; 
                            $GRdata=mssql_query($GRquery); 
    
                            if ($_POST['Char']!="") 
                            { 
                                $GRquery="SELECT * FROM Character WHERE AccountID='".$_SESSION['user_login_name']."' AND name='".$_POST['Char']."'"; 
                                $GRdata=mssql_query($GRquery); 
                                $GRrow = mssql_fetch_array($GRdata); 
                                if ($GRrow['Resets']>=100) 
                                { 
                                    if ($GRrow['Resets']>100) 
                                    { 
                                        $GRr=$GRrow['Resets']-100; 
                                        $GRpts=intval(25+10000+2000*$GRr); //10000 is the 10k points left that the character will have after GR 
                                        $GRquery="Update Character SET [Resets]='0',[LevelUpPoint]='".$GRpts."',[strength]='25',[dexterity]='25',[vitality]='25',[energy]='25' WHERE AccountID='".$_SESSION['user_login_name']."' AND name='".$_POST['Char']."'"; 
                                    } 
                                    else 
                                    { 
                                        $GRquery="Update Character SET [Resets]='0',[LevelUpPoint]='10000',[strength]='25',[dexterity]='25',[vitality]='25',[energy]='25' WHERE AccountID='".$_SESSION['user_login_name']."' AND name='".$_POST['Char']."'"; //10000 is the 10k points left that the character will have after GR 
                                    } 
                                    @MSSql_query($GRquery) or die('Error While Trying to Stats Reset! <br/>'.mssql_get_last_message()); 
                                    //-- 
                                    $crquery="Select * FROM MEMB_CREDITS WHERE memb___id='".$_SESSION['user_login_name']."'"; 
                                    $crdata=mssql_query($crquery); 
                                    $crrow = mssql_fetch_array($crdata); 
                                    $GRcredits=$crrow['credits']; 
                                    //-- 
                                    $GRcredits=$GRcredits+1000; //1000 is the credits reward 
                                    $GRquery="Update MEMB_CREDITS SET [credits]='$GRcredits' WHERE memb___id='".$_SESSION['user_login_name']."'"; 
                                    @MSSql_query($GRquery) or die('Error While Trying to Add WebShop Credits! <br/>'.mssql_get_last_message()); 
                                    echo 'Character '.$_POST['Char'].' was successfully GrandReseted!<br/>'; 
                                    echo 'Credits were added to your WebShop Account!'; 
                                } 
                            } 
                            else 
                            { 
                                echo ' 
                                <script type="text/javascript"> 
                                function get_radio_value() 
                                { 
                                for (var i=0; i < document.myform.Char.length; i++) 
                                   { 
                                   if (document.myform.Char[i].checked) 
                                      { 
                                      rad_val = document.myform.Char[i].value; 
                                      alert("Character Selected: "+rad_val+"  Will Be Grand Reseted! :)"); 
                                      return true; 
                                      } 
                                   } 
                                } 
                                </script> 
                                '; 
                                echo '<form name="myform" action="AvengerSMu-Characters-GrandReset.html" method="POST">'; 
                                $GRchars=0; 
                                do { 
                                    while ($row = mssql_fetch_row($GRdata)) { 
                                        echo ('<input type="radio" name="Char" value="'.$row[0].'"> '.$row[0].'<br> '); 
                                        $GRchars = $GRchars +1; 
                                    } 
                                } while (mssql_next_result($GRdata)); 
                                echo '<input type="submit" value="Submit" onClick="return get_radio_value();"/></form>'; 
                                if ($GRchars == 0) 
                                { 
                                    echo "No Character over 100 RR found !"; 
                                } 
                            }                         
                        break; 
                        //END OF GR SYSTEM



Advertisement