Jump to content

Recommended Posts

Posted

Hi everyone i started java 2 days now so dont blame me if you see noobie code.

Btw i always wanted to make this so i choose this for my 1st program.

I never seen this anywhere or heard about it, its purely my creation and i always wanted to share it so here you go.

 

Description:

This is an enchant calculator. You must put 4 data.

1)Enchant Rate (example: 66)

2)Safe enchant (example: 3)

3)Server max enchant limit (example: 30)

4)Scroll Price (in million example: 5,5) added on V1.1

5)The adena (in millions) that a player can farm per hour. added on V1.2

6)The total hours a player farm per day. added on V1.2

 

Result:

It will show you 5 stats next of each enchant.

1)The percentage of achieving this enchant straight without fail.

2)How many tries are need to achieve this enchant.

3)How many adenas you will need for the total scrolls. added on V1.1

4)Its the total scrolls that you will need. added on V1.1

5)It shows the farm hours that are needed. added on V1.2

6)It shows the days needed to get this enchant. added on V1.2

 

The results are the same but in a different way of showing.

 

Result Sample from V1.2

Here is an example of its output.

Note that the result's of this application are the closest towards chance.
Put the enchant rate (example: 66) : 
66
Put the safe (example: 3) : 
3
Put the max enchant (example: 30) : 
16
Put the Scroll Price (Put it in millions example: 5,5) : 
5
Put the adena that a player can farm per hour *in millions (example: 22,5) : 
10
Put the hours that a player will farm per day (example: 5) : 
3
+1 100% - You will need total 5.0 million adena(s) or (1)Scroll(s) - You will need total 0.5(hours) farming and 0.16666666666666666 (Day's) of farming.
+2 100% - You will need total 10.0 million adena(s) or (2)Scroll(s) - You will need total 1.0(hours) farming and 0.3333333333333333 (Day's) of farming.
+3 100% - You will need total 15.0 million adena(s) or (3)Scroll(s) - You will need total 1.5(hours) farming and 0.5 (Day's) of farming.
+4 66.0 % - 1/ 1 - You will need about 20.0 million adena(s) or (4)Scroll(s) - You will need total 2.0(hours) farming and 0.6666666666666666 (Day's) of farming.
+5 43.56 % - 1/ 2 - You will need about 50.0 million adena(s) or (10)Scroll(s) - You will need total 5.0(hours) farming and 1.6666666666666667 (Day's) of farming.
+6 28.7496 % - 1/ 3 - You will need about 90.0 million adena(s) or (18)Scroll(s) - You will need total 9.0(hours) farming and 3.0 (Day's) of farming.
+7 18.974736 % - 1/ 5 - You will need about 175.0 million adena(s) or (35)Scroll(s) - You will need total 17.5(hours) farming and 5.833333333333333 (Day's) of farming.
+8 12.52332576 % - 1/ 7 - You will need about 280.0 million adena(s) or (56)Scroll(s) - You will need total 28.0(hours) farming and 9.333333333333334 (Day's) of farming.
+9 8.2653950016 % - 1/ 12 - You will need about 540.0 million adena(s) or (108)Scroll(s) - You will need total 54.0(hours) farming and 18.0 (Day's) of farming.
+10 5.455160701056 % - 1/ 18 - You will need about 900.0 million adena(s) or (180)Scroll(s) - You will need total 90.0(hours) farming and 30.0 (Day's) of farming.
+11 3.60040606269696 % - 1/ 27 - You will need about 1485.0 million adena(s) or (297)Scroll(s) - You will need total 148.5(hours) farming and 49.5 (Day's) of farming.
+12 2.3762680013799935 % - 1/ 42 - You will need about 2520.0 million adena(s) or (504)Scroll(s) - You will need total 252.0(hours) farming and 84.0 (Day's) of farming.
+13 1.5683368809107958 % - 1/ 63 - You will need about 4095.0 million adena(s) or (819)Scroll(s) - You will need total 409.5(hours) farming and 136.5 (Day's) of farming.
+14 1.0351023414011253 % - 1/ 96 - You will need about 6720.0 million adena(s) or (1344)Scroll(s) - You will need total 672.0(hours) farming and 224.0 (Day's) of farming.
+15 0.6831675453247428 % - 1/ 146 - You will need about 10950.0 million adena(s) or (2190)Scroll(s) - You will need total 1095.0(hours) farming and 365.0 (Day's) of farming.
+16 0.45089057991433024 % - 1/ 221 - You will need about 17680.0 million adena(s) or (3536)Scroll(s) - You will need total 1768.0(hours) farming and 589.3333333333334 (Day's) of farming.

 

Program Source - [Enchant Calculator v1.2]

import java.util.Scanner;

public class EnchantCalculator
{
public static void main(String[] args)
{
	Scanner sc = new Scanner(System.in);
	System.out.println("Note that the result's of this application are the closest towards chance.");
	System.out.println("Put the enchant rate (example: 66) : ");
	int chance = sc.nextInt();
	System.out.println("Put the safe (example: 3) : ");
	int safe = sc.nextInt();
	System.out.println("Put the max enchant (example: 30) : ");
	int maxenchant = sc.nextInt();
	System.out.println("Put the Scroll Price (Put it in millions example: 5,5) : ");
	double scrollprice = sc.nextDouble();
	System.out.println("Put the adena that a player can farm per hour *in millions (example: 22,5) : ");
	double adenaphour = sc.nextDouble();
	System.out.println("Put the hours that a player will farm per day (example: 5) : ");
	int hoursfarm = sc.nextInt();
	int var4,scrollsamount;
	int enchant = 0;
	double scrolltotalprice,var3,totalhours,daysneed;
	double var1 = 100;
	double var2=100;
	var1 /= chance;		
	while (enchant!=maxenchant)
		if (enchant<safe)
		{
			enchant++;
			scrollsamount = enchant;
			scrolltotalprice = enchant * scrollprice;
			totalhours = scrolltotalprice / adenaphour;
			daysneed = scrolltotalprice / (adenaphour * hoursfarm) ;
			System.out.println("+" + enchant + " 100% - You will need total " + scrolltotalprice + " million adena(s) or (" + enchant + ")Scroll(s) - You will need total " + totalhours + "(hours) farming and " + daysneed + " (Day's) of farming.");
		}
		else
		{
			enchant++;
			var2 /= var1;
			var3 = 100/var2;
			var4 = (int) var3;
			if (var4==1)
			{
				scrolltotalprice = enchant * scrollprice;
				scrollsamount = enchant;
			}
			else
			{
				scrolltotalprice = enchant * var4 * scrollprice;
				scrollsamount = enchant * var4;
			}
			totalhours = scrolltotalprice / adenaphour;
			daysneed = scrolltotalprice / (adenaphour * hoursfarm) ;
			System.out.println("+" + enchant + " " + var2 + " %" + " - 1/ " + var4 + " - You will need about " + scrolltotalprice + " million adena(s) or (" + scrollsamount + ")Scroll(s) - You will need total " + totalhours + "(hours) farming and " + daysneed + " (Day's) of farming.");
		}
}
}

 

TO-DO

 

New Inputs:

  • Scroll price(Done v1.1)
  • Farm per hour(adena) Done v1.2
  • Hours farming per day  Done v1.2

 

New Results:

  • Total Money that will be needed (Done v1.1)
  • Scrolls that will be needed. Done v1.2
  • Total hours farming need to achieve the enchant. Done v1.2
  • Days that will be needed to achieve enchant. Done v1.2

 

Mods:  Catch exceptions, cleaner code, better var naming.

 

Update-1:

1)I'm naming this Enchant Calculator v1.0

 

Update-2:

I know its pretty soon but i update it.

1)V1.1 Released

2)Scroll price input added, and new output total scroll price

 

Update-3:

1)v1.2 Released

Posted

Well i wasnt "expecting" the 1st reply in this topic to be from a spammer but anyway its better than nothing.

Its not something hard but i think its really helpfull for admins to calculate the enchant rate of their server with actual stats and  not just a guess rate seen from another server.

Posted

Kinda pointless IMHO.

 

1, 2, 3 and 4 - can be achieved via a simple windows calculator (never heard of ^ ?)

5 - is totally random, fully depends of the player itself, of the level, of the zone, if he dies from pvp, of the gear, if he's on party or not...

6 - don't say to all, it's a secret, but a day is 24 hours long - until you prove me you can break the barrier of time, that's the max amount (and no PHX can't extend it, don't try at home children) :).

 

And sorry that the second answer was too from a spammer ^^.

 

Regards,

 

Tk.

Posted

Kinda pointless IMHO.

 

1, 2, 3 and 4 - can be achieved via a simple windows calculator (never heard of ^ ?)

5 - is totally random, fully depends of the player itself, of the level, of the zone, if he dies from pvp, of the gear, if he's on party or not...

6 - don't say to all, it's a secret, but a day is 24 hours long - until you prove me you can break the barrier of time, that's the max amount (and no PHX can't extend it, don't try at home children) :).

 

And sorry that the second answer was too from a spammer ^^.

 

Regards,

 

Tk.

 

Are you really a Dev??? Anyway i dont know you nor i need to find more about you but your post was a total fail.

Please check again before trying to make "smart a$$" posts btw you dont have to be mean no1 assigned you this duty, even if i was wrong you could support a bit my effort or correct me, saying that a day is 24 hours you just try to be "another mean guy playing the smart a$$" cause everyone knows that a day is ALMOST 24 hours if you dont already know.

 

Btw i dont need to make a comment for any part of your post cause it was a fail from the start. Especially ur answer for the 5 result..

 

You know statistic or math at all? and especially manners?

Posted

Are you really a Dev??? Anyway i dont know you nor i need to find more about you but your post was a total fail.

Please check again before trying to make "smart a$$" posts btw you dont have to be mean no1 assigned you this duty, even if i was wrong you could support a bit my effort or correct me, saying that a day is 24 hours you just try to be "another mean guy playing the smart a$$" cause everyone knows that a day is ALMOST 24 hours if you dont already know.

 

Btw i dont need to make a comment for any part of your post cause it was a fail from the start. Especially ur answer for the 5 result..

 

You know statistic or math at all? and especially manners?

Agreed with Darule.It's a math based program, needed lots of hours I guess to complete something like that.I'm not going to use it but I bow...Good job mate keep doing this excellent work.

Posted

i'd recomend you to use an eol for terminal i/o software lifetime

 

Thanks for the suggestion ill try it even though i dont know what it is yet.. :D

Posted

eol stands for End Of Life

for terminal i/o, is basically:

 

while(input.user_choice !=  option_exit) {

  read input stuff

  do stuff

  write output stuff

}

 

So you dont have to launch the program everytime you wanna use it

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.



  • Posts

    • hello everyone! I am wanting to save the files (Ini. - Data - ) of the EP5 Client: Salvation... But they generate the error "corrupt files"... I tried several versions of L2FileEditor without good results. I need help! Thank you!
    • Opening December 6th at 19:00 (GMT +3)! Open Beta Test from November 30th!   https://l2soe.com/   🌟 Introducing L2 Saga of Eternia: A Revolution in Lineage 2 High Five! 🌟   Dear Lineage 2 enthusiasts, Prepare to witness the future of private servers! L2 Saga of Eternia is not just another High Five project—it’s a game-changing experience designed to compete with the giants of the Lineage 2 private server scene. Built for the community, by the community, we’re here to raise the bar in quality, innovation, and longevity. What Sets Us Apart? 💎 No Wipes, Ever Say goodbye to the fear of losing your progress. Our server is built to last and will never close. Stability and consistency are our promises to you. ⚔️ Weekly New Content Our dedicated development team ensures fresh challenges, events, and updates every week. From custom quests to exclusive features, there will always be something exciting to explore. 💰 No Pay-to-Win Skill and strategy matter most here. Enjoy a balanced gameplay environment where your achievements come from effort, not your wallet. 🌍 A Massive Community With 2000+ players expected, join a vibrant and active community of like-minded adventurers ready to conquer the world of Aden. 🏆 Fair and Competitive Gameplay Our systems are designed to promote healthy competition while avoiding abusive mechanics and exploits. 🔧 Professional Development From advanced bug fixes to carefully curated content, we pride ourselves on smooth performance, no lag, and unparalleled server quality. Key Features Chronicle: High Five with unique interface Rate: Dynamic x10 rates Class Balance: Carefully fine-tuned for a fair experience PvP Focused: PvP Ranking & aura display effect for 3 Top PvPers every week Custom Events: Seasonal and permanent events to keep you engaged Additional Features:   Custom Endgame Content: Introduce unique dungeons, raids, or zones unavailable in other servers. Player-Driven Economy: Implement a strong market system and avoid overinflated drops or rewards. Epic Siege Battles: Announce special large-scale sieges and PvP events. Incentives for Streamers and Clans: Attract influencers and big clans to boost server publicity. Roadmap Transparency: Share a public roadmap of planned updates to build trust and excitemen   Here you can read all the features: https://l2soe.com/features   Video preview: Join the Revolution! This is your chance to be part of something legendary. L2 Saga of Eternia is not just a server; it’s a movement to redefine what Lineage 2 can be. Whether you’re a seasoned veteran or a newcomer to the world of Aden, we invite you to experience Lineage 2 at its finest.   Official Launch Date: December 6th 2024 Website: https://l2soe.com/ Facebook: https://www.facebook.com/l2soe Discord: https://discord.com/invite/l2eternia   Let’s build the ultimate Lineage 2 experience together. See you in-game! 🎮
    • That's like a tutorial on how to run l2 on MacOS Xd but good job for the investigation. 
    • small update: dc robe set sold   wts adena 1kk = 1.5$ 
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/hood-services https://campsite.bio/utchihaamkt
  • Topics

×
×
  • Create New...