Register for your free account! | Forgot your password?

You last visited: Today at 06:56

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Attack dodge calculation

Discussion on Attack dodge calculation within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
pintinho12's Avatar
 
elite*gold: 0
Join Date: Jul 2009
Posts: 943
Received Thanks: 408
Attack dodge calculation

Ok guys, it's 7:20 am and tonight I've been working on this shit

Code:
public bool IsTargetDodged(IRole attacker, IRole attacked)
{
    if (attacker == null || attacked == null) return true;
    int nDodge = 0;
    if (attacked is Character || attacked is DynamicNpc || (attacked is Monster && (attacked as Monster).IsBoss))
        nDodge = 40;
    int atkHit = attacker.AttackHitRate;
    int atkdDodge = attacked.Dodge;
    int hitRate = Math.Min(100, Math.Max(40, 100 + atkHit - nDodge - atkdDodge));
    return !Calculations.ChanceCalc(hitRate);
}
Ok, there is a default dodge for characters which is 40% and it's stored in nDodge, that's simple.
atkHit will store the attacker hitrate, but how do I get this value?
The attacker hitrate is the addition of all items agility (except talismans and steed).
Example: If I'm wearing 2 level 140 beads, I'll get 202 hitrate (since each one will have +23 agility from the plus and +78 from the beads).
Sure, after that, the attacker hitrate isn't finished yet, you need to add the user Agility Points.
The attacker hit rate after all will be divided by three. So we have 125,33 hitrate points.

My tests were done with 175 Agility Points in my character (and by my experience with monks, since i've been one for years), the same I used in my full +12 monk



over the years in Conquer 2.0, I should say that the calculation is 99% correct.
So after all, I've got (202 + 175)/3 which will give me around 125 hit rate points. Great!
The attacked dodge, will be the target dodge for sure. A full +12 player got 104 dodge.
But, as you can see. We add 100 points to the Attacker Hit Rate, so we get 225 points, we subtract the nDodge and the attacked dodge, so we have remaining
a 81% hitrate. Which is very precise, as far as I remember from the gold times killing fires with triple hit #16

I never really took time looking at the public sources to see how they calculate it, but I'm pretty sure that this algorithm is worth a try.
If you guys try it out, please leave a feedback. I tested this with a monk and I'll be doing more tests later. If you guys think there is something wrong or there is something that might be improved, please tell me.

Hope it's useful since I didn't find any really useful guide out there.
pintinho12 is offline  
Thanks
5 Users
Old 07/14/2017, 11:29   #2
 
elite*gold: 0
Join Date: Aug 2014
Posts: 13
Received Thanks: 2
Great work, I've a small note about the last check
if (hitRate < 40)
hitRate = 40;
It's impossible
this will get you at least 40 Math.Max(40, 100 + atkHit - nDodge - atkdDodge)
so Math.Min(100, Math.Max(40, 100 + atkHit - nDodge - atkdDodge)); must give you more than 40 or equals 40 every time..
kerohero is offline  
Thanks
1 User
Old 07/19/2017, 08:11   #3
 
JaniQ's Avatar
 
elite*gold: 0
Join Date: Apr 2014
Posts: 117
Received Thanks: 91
Code:
Math.Max(40, 100 + atkHit - nDodge - atkdDodge)
Should always return 40 if "100 + atkHit - nDodge - atkdDodge" is less than 40.

thus making
Code:
 if (hitRate < 40)
        hitRate = 40;
redundant.
JaniQ is offline  
Old 07/19/2017, 21:59   #4
 
U2_Caparzo's Avatar
 
elite*gold: 0
Join Date: Aug 2011
Posts: 314
Received Thanks: 90
Quote:
Originally Posted by kerohero View Post
Great work, I've a small note about the last check
if (hitRate < 40)
hitRate = 40;
It's impossible
this will get you at least 40 Math.Max(40, 100 + atkHit - nDodge - atkdDodge)
so Math.Min(100, Math.Max(40, 100 + atkHit - nDodge - atkdDodge)); must give you more than 40 or equals 40 every time..
Quote:
Originally Posted by pitinho12
Ok guys, it's 7:20 am and tonight I've been working on this ****
U2_Caparzo is offline  
Old 07/23/2017, 16:48   #5
 
pintinho12's Avatar
 
elite*gold: 0
Join Date: Jul 2009
Posts: 943
Received Thanks: 408
I removed some code before posting because I was performing tests.
Good you guys know how to fix things. The calc is there and it's what matters.
The code had comments and ****, I just cleaned it a little bit, tho I didn't it perfectly, but I did.
Thanks for the feedback tho
pintinho12 is offline  
Thanks
1 User
Old 12/12/2017, 10:58   #6
 
Ultimation's Avatar
 
elite*gold: 0
Join Date: Mar 2005
Posts: 1,430
Received Thanks: 1,586
this is from the EO source and is slightly different in conquer.
Ultimation is offline  
Old 12/13/2017, 00:57   #7
 
pintinho12's Avatar
 
elite*gold: 0
Join Date: Jul 2009
Posts: 943
Received Thanks: 408
Yep, I adapted it on another source.
pintinho12 is offline  
Old 12/17/2017, 19:45   #8
 
Ultimation's Avatar
 
elite*gold: 0
Join Date: Mar 2005
Posts: 1,430
Received Thanks: 1,586
But the code posted here is wrong for co..
Ultimation is offline  
Old 02/24/2022, 00:08   #9
 
elite*gold: 0
Join Date: May 2011
Posts: 88
Received Thanks: 4
Quote:
Originally Posted by Ultimation View Post
But the code posted here is wrong for co..
Do you have the calculation that tq uses? or something close
57bob57 is offline  
Old 02/24/2022, 00:48   #10
 
Ultimation's Avatar
 
elite*gold: 0
Join Date: Mar 2005
Posts: 1,430
Received Thanks: 1,586
Quote:
Originally Posted by 57bob57 View Post
Do you have the calculation that tq uses? or something close
as much as i appreciate you using the search feature, this thread is 5 years old, you should have just left it dead :P
Ultimation is offline  
Thanks
1 User
Old 02/25/2022, 00:59   #11
 
elite*gold: 0
Join Date: May 2011
Posts: 88
Received Thanks: 4
Quote:
Originally Posted by Ultimation View Post
as much as i appreciate you using the search feature, this thread is 5 years old, you should have just left it dead :P
Hahaaa, my question was just not to open a new post, now answer me how you can help me with the atack calculations, bp .. .
57bob57 is offline  
Reply


Similar Threads Similar Threads
Metin2 attack calculation tool
03/03/2016 - Metin2 PServer Guides & Strategies - 0 Replies
https://github.com/SonGohanMetin2/jacg jacg Repository for the Java Attack Calculus Gear (Metin2 attack calculation tool) The Java Attack Calculus Gear is the latest-generation tool for Attack and Damage calculation in Metin2. It was created by Son Gohan in 2013 and exploits a bunch of game formulas discovered by Son Gohan, Mystikal (former wiki.metin2.it staff) and some other Italian Metin2 players, particularly AlbyElite. NOTE: ATM, the tool is in Italian only. If you'd like the...
[NEW] RF Online Engine For GamesCampus Damage Hack-Attack Speed Hack-Dodge Hack-Duper
08/29/2014 - RFO Hacks, Bots, Cheats, Exploits & Guides - 5 Replies
Edit.
[Question] Archer Attack Calculation
07/09/2014 - CO2 Private Server - 4 Replies
As the topic title says ... I would like to know how to attack Archer is calculated. It is the same as the others? How?
[NEW] RF Online Engine For GamesCampus Damage Hack-Attack Speed Hack-Dodge Hack-Duper
03/11/2013 - RF Online - 8 Replies
Edit.



All times are GMT +1. The time now is 06:57.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.