• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

How to add Grand Reset System to your muweb site

Initiate Mage
Joined
May 27, 2011
Messages
3
Reaction score
8
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:
		            //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:
Initiate Mage
Joined
Nov 26, 2011
Messages
2
Reaction score
0
well is it possible to make it a 5 resets for the grand reset? and 65400 on all stats instead of back to 25?
 
Newbie Spellweaver
Joined
Feb 18, 2009
Messages
23
Reaction score
0
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:
Newbie Spellweaver
Joined
Mar 18, 2009
Messages
30
Reaction score
1
Yes, I have the same, how to make GrandReset showing on Rankings?
 
Initiate Mage
Joined
Feb 24, 2012
Messages
1
Reaction score
0
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
 
Experienced Elementalist
Joined
Nov 29, 2009
Messages
259
Reaction score
30
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:
Newbie Spellweaver
Joined
Oct 14, 2007
Messages
37
Reaction score
3
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.
 
Newbie Spellweaver
Joined
Nov 19, 2011
Messages
12
Reaction score
0
same error on me
 
Initiate Mage
Joined
Nov 27, 2013
Messages
1
Reaction score
0
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 :)
 
Experienced Elementalist
Joined
Jan 25, 2012
Messages
235
Reaction score
1
where to put this code >>
Code:
                    //GR SYSTEM                     
                    case "GrandReset": 
                        $grdb=mssql_connect('localhost', 'SQL_USERNAME', 'SQL_PASSWORD') or die('error'); 
                        [USER=1333430285]MSS[/USER]ql_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 
                                } 
                                [USER=1333430285]MSS[/USER]ql_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']."'"; 
                                [USER=1333430285]MSS[/USER]ql_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
 
Back
Top