Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

GUI - Leadertool

Newbie Spellweaver
Joined
Dec 5, 2010
Messages
29
Reaction score
3
Well, as I already posted this thing made in PHP and checked some things, I came to the result that this wouldn't be safe at all.

Therefor I decided to make this thing simply in C++
It is actually nothing special, you can make that also with some SQL Queries. Anyway, it saves some time and does the work you're to lazy to do ;)

Hope5 - GUI - Leadertool - RaGEZONE Forums


When you set someone to a leader he automatically get's a leader shield, 5 Happy Hours and the things which increase the attackpower for 30 minutes.

That works also on the other way.
When you remove the leaders, the leader shield and all the other things will get deleted automatically.

The other things should be clear.

Have fun with it
Hope
 

Attachments

You must be registered for see attachments list
Last edited:
Retired (Goddamn idiots)
Joined
Dec 3, 2003
Messages
391
Reaction score
483
While the effort is admirable, the whole thing can be done in a simple procedure.
But then again, we are appealing to the mass public here, and they're incapable of doing anything but beg for the easiest possible thing.
Mind you, I foresee whining and begging for "HOW DO YOU ...." here.

All in all, well done.
 
Experienced Elementalist
Joined
May 9, 2011
Messages
222
Reaction score
34
In speaking about leader set, i made one personally too, but i ask myself one thing, if there is election and vote, there is no way to automated this ? I mean there are lot's of table about leaders, there are no table that are supposed to "to do the job" i mean green name, adesive and all? it's a little curious i think no?
 
Experienced Elementalist
Joined
May 9, 2011
Messages
222
Reaction score
34
Hmm, i think there is a way to automated it, there is no reason,for exemple like a service that start on a date,check vote systeme and make it for exemple
 
Newbie Spellweaver
Joined
Dec 5, 2010
Messages
29
Reaction score
3
It wouldn't be that hard to create such a thing which does that automatically. But anyway, I think you should be able to invest 1 minute in a month for the game..
 
Experienced Elementalist
Joined
May 9, 2011
Messages
222
Reaction score
34
There is maybe only one problem or it's maybe just me or don't understand, when i use your tool i can set a leader from a nation but when i do it again for the other nation,that say that i should reset leader before doing it. So i can set a leader from one nation but not the other one. Or should i write the both lead in the charactername box with a "," for exemple or something like that?
 
Newbie Spellweaver
Joined
Dec 5, 2010
Messages
29
Reaction score
3
Should work now :)

@ Mod please replace the attachment in the first post with this here!
 

Attachments

You must be registered for see attachments list
Experienced Elementalist
Joined
Apr 29, 2006
Messages
279
Reaction score
90
You should correct that it was written in C# instead of C++.

And you might as well release the source code:

Code:
using System.Data;
using System.Data.SqlClient;

...

        private void button1_Click(object sender, EventArgs e)
        {
            SqlConnection connection = new SqlConnection("server=(local);Integrated Security=SSPI; database=atum2_db_1");
            try
            {
                if (MessageBox.Show("Are you sure that you want to reset the leaders?", "Reset the leaders", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    connection.Open();
                    new SqlCommand("UPDATE [atum2_db_1].[dbo].[td_InfluenceWarData] SET InflLeaderCharacterUID = 0 WHERE InfluenceType='2'", connection).ExecuteNonQuery();
                    new SqlCommand("UPDATE [atum2_db_1].[dbo].[td_InfluenceWarData] SET InflLeaderCharacterUID = 0 WHERE InfluenceType='4'", connection).ExecuteNonQuery();
                    new SqlCommand("UPDATE [atum2_db_1].[dbo].[td_InfluenceWarData] SET InflSub1LeaderCharacterUID = 0 WHERE InfluenceType='2'", connection).ExecuteNonQuery();
                    new SqlCommand("UPDATE [atum2_db_1].[dbo].[td_InfluenceWarData] SET InflSub1LeaderCharacterUID = 0 WHERE InfluenceType='4'", connection).ExecuteNonQuery();
                    new SqlCommand("UPDATE [atum2_db_1].[dbo].[td_InfluenceWarData] SET InflSub2LeaderCharacterUID = 0 WHERE InfluenceType='2'", connection).ExecuteNonQuery();
                    new SqlCommand("UPDATE [atum2_db_1].[dbo].[td_InfluenceWarData] SET InflSub2LeaderCharacterUID = 0 WHERE InfluenceType='4'", connection).ExecuteNonQuery();
                    new SqlCommand("DELETE FROM [atum2_db_1].[dbo].[td_Store] WHERE ItemNum = '7001320' OR ItemNum = '7001330'", connection).ExecuteNonQuery();
                    new SqlCommand("DELETE FROM [atum2_db_1].[dbo].[td_Store] WHERE ItemNum = '7001090'", connection).ExecuteNonQuery();
                    new SqlCommand("DELETE FROM [atum2_db_1].[dbo].[td_Store] WHERE ItemNum = '7016170'", connection).ExecuteNonQuery();
                    new SqlCommand("DELETE FROM [atum2_db_1].[dbo].[td_Store] WHERE ItemNum = '7001110'", connection).ExecuteNonQuery();
                    MessageBox.Show("The leaders have been successfully reseted!");
                    connection.Close();
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception.ToString());
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            string text = this.textBox1.Text;
            if (text == "")
            {
                MessageBox.Show("Please enter a username first!");
            }
            else
            {
                SqlConnection connection = new SqlConnection("server=(local);Integrated Security=SSPI; database=atum2_db_1");
                try
                {
                    connection.Open();
                    int num = 0;
                    SqlCommand command = new SqlCommand("SELECT InflLeaderCharacterUID FROM [atum2_db_1].[dbo].[td_InfluenceWarData] WHERE InfluenceType = '4'", connection);
                    int num2 = (int) command.ExecuteScalar();
                    SqlCommand command2 = new SqlCommand("SELECT InflLeaderCharacterUID FROM [atum2_db_1].[dbo].[td_InfluenceWarData] WHERE InfluenceType = '2'", connection);
                    int num3 = (int) command2.ExecuteScalar();
                    SqlCommand command3 = new SqlCommand("SELECT Count(*) FROM [atum2_db_1].[dbo].[td_Character] WHERE CharacterName = @CharacterName", connection);
                    command3.Parameters.AddWithValue("@CharacterName", text);
                    if (((int) command3.ExecuteScalar()) != 0)
                    {
                        SqlCommand command4 = new SqlCommand("SELECT UniqueNumber FROM [atum2_db_1].[dbo].[td_Character] WHERE CharacterName = @CharacterName", connection);
                        command4.Parameters.AddWithValue("@CharacterName", text);
                        num = (int) command4.ExecuteScalar();
                        if ((num2 == 0) || ((num3 == 0) && (num != 0)))
                        {
                            if (MessageBox.Show(string.Format("Are you sure that you want to set '{0}' to a leader?", text.ToUpper()), "Set a leader", MessageBoxButtons.YesNo) == DialogResult.Yes)
                            {
                                SqlCommand command5 = new SqlCommand("SELECT InfluenceType FROM [atum2_db_1].[dbo].[td_Character] WHERE CharacterName = @CharacterName", connection);
                                command5.Parameters.AddWithValue("@CharacterName", text);
                                int num5 = (byte) command5.ExecuteScalar();
                                SqlCommand command6 = new SqlCommand("SELECT AccountUniqueNumber FROM [atum2_db_1].[dbo].[td_Character] WHERE CharacterName = @CharacterName", connection);
                                command6.Parameters.AddWithValue("@CharacterName", text);
                                int num6 = (int) command6.ExecuteScalar();
                                switch (num5)
                                {
                                    case 2:
                                    {
                                        SqlCommand command7 = new SqlCommand("UPDATE [atum2_db_1].[dbo].[td_InfluenceWarData] SET InflLeaderCharacterUID = @UID WHERE InfluenceType='2'", connection);
                                        command7.Parameters.AddWithValue("@UID", num);
                                        command7.ExecuteNonQuery();
                                        SqlCommand command8 = new SqlCommand("INSERT INTO [atum2_db_1].[dbo].[td_Store] (AccountUniqueNumber,Possess,ItemStorage,Wear,CurrentCount,ItemNum) VALUES (@AccID,@UID,'0','0','1','7001320')", connection);
                                        command8.Parameters.AddWithValue("@AccID", num6);
                                        command8.Parameters.AddWithValue("@UID", num);
                                        command8.ExecuteNonQuery();
                                        SqlCommand command9 = new SqlCommand("INSERT INTO [atum2_db_1].[dbo].[td_Store] (AccountUniqueNumber,Possess,ItemStorage,Wear,CurrentCount,ItemNum) VALUES (@AccID, @UID,'0','0','5','7001090')", connection);
                                        command9.Parameters.AddWithValue("@AccID", num6);
                                        command9.Parameters.AddWithValue("@UID", num);
                                        command9.ExecuteNonQuery();
                                        SqlCommand command10 = new SqlCommand("INSERT INTO [atum2_db_1].[dbo].[td_Store] (AccountUniqueNumber,Possess,ItemStorage,Wear,CurrentCount,ItemNum) VALUES (@AccID,@UID,'0','0','1','7016170')", connection);
                                        command10.Parameters.AddWithValue("@AccID", num6);
                                        command10.Parameters.AddWithValue("@UID", num);
                                        command10.ExecuteNonQuery();
                                        SqlCommand command11 = new SqlCommand("INSERT INTO [atum2_db_1].[dbo].[td_Store] (AccountUniqueNumber,Possess,ItemStorage,Wear,CurrentCount,ItemNum) VALUES (@AccID,@UID,'0','0','5','7001110')", connection);
                                        command11.Parameters.AddWithValue("@AccID", num6);
                                        command11.Parameters.AddWithValue("@UID", num);
                                        command11.ExecuteNonQuery();
                                        new SqlCommand("UPDATE [atum2_db_1].[dbo].[td_InfluenceWarData] SET  WartimeStage = 0 WHERE InfluenceType='2'", connection).ExecuteNonQuery();
                                        break;
                                    }
                                    case 4:
                                    {
                                        SqlCommand command13 = new SqlCommand("UPDATE [atum2_db_1].[dbo].[td_InfluenceWarData] SET InflLeaderCharacterUID = @UID WHERE InfluenceType='4'", connection);
                                        command13.Parameters.AddWithValue("@UID", num);
                                        command13.ExecuteNonQuery();
                                        SqlCommand command14 = new SqlCommand("INSERT INTO [atum2_db_1].[dbo].[td_Store] (AccountUniqueNumber,Possess,ItemStorage,Wear,CurrentCount,ItemNum) VALUES (@AccID,@UID,'0','0','1','7001330')", connection);
                                        command14.Parameters.AddWithValue("@AccID", num6);
                                        command14.Parameters.AddWithValue("@UID", num);
                                        command14.ExecuteNonQuery();
                                        SqlCommand command15 = new SqlCommand("INSERT INTO [atum2_db_1].[dbo].[td_Store] (AccountUniqueNumber,Possess,ItemStorage,Wear,CurrentCount,ItemNum) VALUES (@AccID,@UID,'0','0','5','7001090')", connection);
                                        command15.Parameters.AddWithValue("@AccID", num6);
                                        command15.Parameters.AddWithValue("@UID", num);
                                        command15.ExecuteNonQuery();
                                        SqlCommand command16 = new SqlCommand("INSERT INTO [atum2_db_1].[dbo].[td_Store] (AccountUniqueNumber,Possess,ItemStorage,Wear,CurrentCount,ItemNum) VALUES (@AccID,@UID,'0','0','1','7016170')", connection);
                                        command16.Parameters.AddWithValue("@AccID", num6);
                                        command16.Parameters.AddWithValue("@UID", num);
                                        command16.ExecuteNonQuery();
                                        SqlCommand command17 = new SqlCommand("INSERT INTO [atum2_db_1].[dbo].[td_Store] (AccountUniqueNumber,Possess,ItemStorage,Wear,CurrentCount,ItemNum) VALUES (@AccID,@UID,'0','0','5','7001110')", connection);
                                        command17.Parameters.AddWithValue("@AccID", num6);
                                        command17.Parameters.AddWithValue("@UID", num);
                                        command17.ExecuteNonQuery();
                                        new SqlCommand("UPDATE [atum2_db_1].[dbo].[td_InfluenceWarData] SET  WartimeStage = 0 WHERE InfluenceType='4'", connection).ExecuteNonQuery();
                                        break;
                                    }
                                }
                                MessageBox.Show("The character has been successfully set to a leader!");
                                connection.Close();
                            }
                        }
                        else
                        {
                            connection.Close();
                            MessageBox.Show("You have to reset the leaders before you can set a new one!");
                        }
                    }
                    else
                    {
                        connection.Close();
                        MessageBox.Show("The charactername you entered doesn't exsit!");
                    }
                }
                catch (Exception exception)
                {
                    Console.WriteLine(exception.ToString());
                }
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            SqlConnection connection = new SqlConnection("server=(local);Integrated Security=SSPI; database=atum2_db_1");
            try
            {
                if (MessageBox.Show("Are you sure that you want to reset the nationpoints?", "Reset the nationpoints", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    connection.Open();
                    new SqlCommand("UPDATE [atum2_db_1].[dbo].[td_InfluenceWarData] SET ContributionPoint = 0 WHERE InfluenceType='2'", connection).ExecuteNonQuery();
                    new SqlCommand("UPDATE [atum2_db_1].[dbo].[td_InfluenceWarData] SET ContributionPoint = 0 WHERE InfluenceType='4'", connection).ExecuteNonQuery();
                    MessageBox.Show("The nation points have been successfully reseted!");
                    connection.Close();
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception.ToString());
            }
        }

Brag brag brag I know C++ brag brag brag trololololo
 
Newbie Spellweaver
Joined
Dec 5, 2010
Messages
29
Reaction score
3
Well I thought it might look more impressive if I'll say it's writen in C++, don't ask me why I thought that. Anyway, is the decompiler writen by yourself your downloaded somewhere?
 
Newbie Spellweaver
Joined
Dec 5, 2010
Messages
29
Reaction score
3
You really have no idea about how .NET code works, do you now?

Yeah, I'm quite new to this things, I used the Borland Builder 5 some time ago and now I've changed to the MS Visual Studio......
 
Joined
Sep 7, 2010
Messages
431
Reaction score
263
C#, and all CLR languages, create a custom assembly thats run by the .net framework. And since the assembly becomes way smaller this way, the devs thought something like "why not let all info in the exe, to make debugging/editing easier"? So with a program like .net reflector you get the source back. Its more or less like java. However there are obfuscators.

Its a good thing someone can make a working algorithm in here tho, cause most people around here cant come up with the hello world application... And i see no reason why no say its in .net, after all .net code is more efficient than native code from many aspects (only problem is theres an overhead when calling native code in .net, interop is slow). And its easier to develop...
 
Back
Top