Jump to content

Code Tournament Event 2.0


Recommended Posts

Hey guys, some time ago I developed this mod from scratch, I present to you the Tournament 2.0.
A fighting system with modes 1 vs 1 / 2 vs 2 / 3 vs 3 / 4 vs 4 / 5 vs 5 / 9 vs 9.

 

 

Currently the code is for aCis, but with minimal knowledge in java you can adapt to any rev or chronicle.

I can lend a hand to anyone who needs this discord: Discord Server Link

Remembering that the system has been successfully tested on small servers, I believe that it will not be long before it gets 100% and be used on large servers, so I kindly ask you to report any bugs you find.

What’s new?

The code has been completely reworked for low memory and disk usage. The system is through listeners and triggers, considerably reducing the number of scheduled tasks and threads and, consequently, the use of system RAM. So let’s go to the list of news:

  • All fights are instantiated: what gives the freedom to have several fights happen in the same place without the players of different fights interfering in their respective fights.
  • Unlimited Arenas: arenas are created through a simple XML where only the spawn coordinates of a player in the world are configured, this means that you can create as many arenas as you want, ANYWHERE ON THE MAP.
  •  Fairer fights: fights were given a different way of picking a winner. They received a duration parameter – countdown – (that’s right, you can set the maximum time for each fight), with that, now there are 3 ways to win a fight:
    1. Having the most live members on your team.
    2. Having dealt more damage than the opposing team at the end of the fight countdown.
    3. If one or more members of the enemy team is out of the combat zone for more than 10 seconds (for that a task – OutOfTheZoneTask – was created).
    If none of the above options are met, the fight will be considered a draw (meaning no damage was dealt or action taken during the fight – that’s right AFK players – and players will not receive rewards.
  • Monitoring of fights: you can now monitor all fights that are currently taking place. Using an admin command you can enter the same instance of the fight and the players involved and thus check for any suspicious activity.
  • Registration in fights: in order for a player to register he must choose the mode he wants to play, if it is a group mode (ie any one other than 1 vs 1), he must create a “TournamentTeam”, ie , he will no longer have the need to form a Party, he will have to invite to his team the members he wants to play with and the code itself will decide if all players are able to battle in the chosen mode.
  • Choice of fights (WIP): fights will no longer be chosen randomly. Each player will have some parameters that determine their “fighting power”.
    1. WDT (Win/Defeat/Ties) – This parameter determines the average wins per tie loss.
    2. DPF (Damage per Fight) – this parameter determines the average damage the player deals per fight.
    These parameters are fully tied to defining the amount of points each player will earn on each win and draw and how much they will lose on each defeat, as well as sorting them into Elos (but this is still a work in progress).
    Defined the amount of points from the DPF and WDT teams will be allocated to play against teams that have a similar “fighting power”, so there will be a greater balance in the Tournament.
  • – Automatic Rankings: last but not least, our specialty. HTMLs being dynamically and automatically generated. At the end of each fight, the data of the players involved are stored in the database. Every player can access
    these data using the command “.mytour” where you will see your own statistics on the tournament and other players. The statistics implemented (for all modes) so far are:
    1. WDT Rate (Win/Defeat/Ties)
    2. DPF (Damage per Fight) – Modes: 1 vs 1 / 2 vs 2 / 3 vs 3 / 4 vs 4 / 5 vs 5 / 9 vs 9.
    3. Total Damage Caused
    4. Damage Caused – Modes: 1 vs 1 / 2 vs 2 / 3 vs 3 / 4 vs 4 / 5 vs 5 / 9 vs 9.
    5. Total Kills
    6. Total Kills – Modes: 1 vs 1 / 2 vs 2 / 3 vs 3 / 4 vs 4 / 5 vs 5 / 9 vs 9.
    7. Total Wins – Modes: 1 vs 1 / 2 vs 2 / 3 vs 3 / 4 vs 4 / 5 vs 5 / 9 vs 9.
    8. Total Losses – Modes: 1 vs 1 / 2 vs 2 / 3 vs 3 / 4 vs 4 / 5 vs 5 / 9 vs 9.
    9. Total draws – Modes: 1 vs 1 / 2 vs 2 / 3 vs 3 / 4 vs 4 / 5 vs 5 / 9 vs 9.

Important Settings:

– Restriction of Skills in the arena.
– Restriction of items in the arena.
– Class restriction in all modes.
– Auto Teleport when starting Tournament 2.0 (Confirm Dialog)
– All other settings described above have the option to be disabled/enabled.

 

 

CKtzUgc.png

Qn4522e.png

FVSxF45.png

4H9j6ky.png

Download: https://mega.nz/file/NdhCgaiZ#n_zgBmXNlgLheVRQQ6XeGpT0klD-4Zwl0NneS1u6NNQ

Rar pass is  https://discord.gg/2C37UszZ

Enjoy

Edited by ZaunProject
  • Like 1
  • Thanks 8
  • Upvote 2
Link to comment
Share on other sites

Interesting share many people been searching for a clean Tournament Engine thanks for sharing with us.

Link to comment
Share on other sites

3 hours ago, ExTrEmEDwarf said:

Give this person a membership.

 

Right now

 

3 hours ago, Celestine said:

Interesting share many people been searching for a clean Tournament Engine thanks for sharing with us.

 

1 hour ago, Vision said:

Thanks for this dude.

You did some brilliant job.

Thank u guys

Link to comment
Share on other sites

try to update your sql queries

Connection con = null;
+		PreparedStatement offline = null;
+		ResultSet rs = null;
+		try
+		{
+			con = ConnectionPool.getConnection();
+			offline = con.prepareStatement("SELECT * FROM character_memo_alt WHERE obj_id =?");
+			offline.setInt(1, player.getObjectId());
+			rs = offline.executeQuery();
+			
+			while (rs.next())
+			{
+				String name = rs.getString("name");
+				String value = rs.getString("value");
+				long expire_time = rs.getLong("expire_time");
+				long curtime = System.currentTimeMillis();
+				
+				if ((expire_time <= curtime) && (expire_time > 0))
+				{
+					deleteExpiredVar(player, name, rs.getString("value")); // TODO: Remove the Var
+					continue;
+				}
+				
+				player.getVariables().put(name, new PlayerVar(player, name, value, expire_time));
+			}
+			
+			con.close();
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace();
+		}
+		finally
+		{
+			Mysql.closeQuietly(con, offline, rs);
+		}

such code is pre JDK8

 

thanks for sharing

  • Thanks 1
Link to comment
Share on other sites

I didn't understand the logic of creating a zone if you define the instance of each fight and also creating a new type of memo if there is already one to store the data of each player. either way you will get my like.

Link to comment
Share on other sites

57 minutes ago, Williams said:

I didn't understand the logic of creating a zone if you define the instance of each fight and also creating a new type of memo if there is already one to store the data of each player. either way you will get my like.

Zone: because OutOfZoneTask

New Memo: because i like this one more.

 

Link to comment
Share on other sites

On 9/12/2021 at 4:49 PM, ZaunProject said:

New Memo: because i like this one more.

this is why i did not say anything about the extra database pool connector since its your code if you like it who am i to say something 😄 but as i said an update would be good.

Edited by Vision
Link to comment
Share on other sites

I think it is rude for one developer to advertise his services in other developer's topic. Not to mention that it's 2 people (nightwolf/kara from same team) who are advertising their services. 

 

@Vision can you clean the topic from spam? people come here for a free share, this is not an advertisement topic.

Edited by imclyde
Link to comment
Share on other sites

52 minutes ago, imclyde said:

I think it is rude for one developer to advertise his services in other developer's topic. Not to mention that it's 2 people (nightwolf/kara from same team) who are advertising their services. 

 

@Vision can you clean the topic from spam? people come here for a free share, this is not an advertisement topic.

 

Actually, that's correct thanks for mentioning me about this.

Topic cleaned from off topic replies or another dev services.

Have a nice day.

Link to comment
Share on other sites

Thanks for sharing. You should also consider to update the whole code style with the new tools that java is offering.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disbaled AdBlock