Issue information

Issue ID
#4464
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Oct 5, 2010 19:51
Last Post
Ind
Apr 16, 2013 3:55
Confirmation
Yes (5)
No (0)

Hercules Elf Bot - Oct 5, 2010 19:51

Originally posted by [b]Inquisetor90[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=4464

Instead, critical hits does 140% of a normal atk or x1.4 damage but they ignore flee.

In /src/map/battle.c, under the function name static struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list *target,int skill_num,int skill_lv,int wflag) ,
there is a statement that says:
CODE
    if (flag.cri)
    {
        wd.type = 0x0a;
        flag.idef = flag.idef2 = flag.hit = 1;
    } else {    //Check for Perfect Hit



To make flag.idef or flag.idef2 equal to 1 means you are ignoring defense to true. So I would suggest to change that to:

CODE
    if (flag.cri)
    {
        wd.type = 0x0a;
        flag.hit = 1;
    } else {    //Check for Perfect Hit


Other problems: This would not make the critical hit deal x1.4 damage even though it would always hit the target without ignoring defense.

Hercules Elf Bot - Dec 17, 2011 4:59

Originally posted by [b]Ind[/b]
I'm not aware of how this is supposed to work, would like info. thanks

Hercules Elf Bot - Jul 3, 2012 10:28

Originally posted by [b]MarkZD[/b]
Confirmed, critical does not ignore defense.
40% damage is added before defense reduction.
It's affected by all reduction including cards.


[quote][color=#000000][font=sans-serif][size=3]Critical Hit Rate: Your critical hit rating, which increase damage by 40%. [/size][/font][/color][url="http://irowiki.org/wiki/Category:Offensive_Skills"]Offensive Skills[/url][color=#000000][font=sans-serif][size=3] do not take CRIT into account except for a few exceptions like [/size][/font][/color][url="http://irowiki.org/wiki/Focused_Arrow_Strike"]Focused Arrow Strike[/url][color=#000000][font=sans-serif][size=3]. Critical Hit also ignore [/size][/font][/color][url="http://irowiki.org/wiki/Flee"]Flee[/url][color=#000000][font=sans-serif][size=3] but not [/size][/font][/color][url="http://irowiki.org/wiki/Perfect_Dodge"]Perfect Dodge[/url][color=#000000][font=sans-serif][size=3] nor [/size][/font][/color][url="http://irowiki.org/wiki/Def"]Def[/url][color=#000000][font=sans-serif][size=3].[/size][/font][/color][/quote]
[url="http://irowiki.org/wiki/Critical#CRIT"]http://irowiki.org/wiki/Critical#CRIT[/url]

[quote][b]% Damage reductions:[/b]
[b][color="black"]Racial reductions : [/color][/b]
[color="black"][color=#000000][font=verdana, geneva, lucida,]Percentual reductions against races, like Thara Frog, Khallizburg and Beret work against both normal attacks and skills.[/font][/color][/color]

[color=#000000][font=verdana, geneva, lucida,][background=rgb(235, 241, 250)]Critical attacks are now also affected by reductions so Racial reductions also work against crits.[/background][/font][/color][/quote]
[url="http://forums.irowiki.org/showpost.php?p=392377&postcount=1"]http://forums.irowiki.org/showpost.php?p=392377&postcount=1[/url]

[quote][color=#000000][font=verdana, geneva, lucida,][background=rgb(235, 241, 250)]FinalDamage = [(① + ② ± ③) * (SkillMod+%Boost) + MasteryATK*(1+%Boost)] * (600 / EquipDEF+600) - StatusDef[/background][/font][/color]

[color=#000000][font=verdana, geneva, lucida,]*%Boost : Special Damage increasing skills like Spear Dynamo (+25%) and Falcon Eyes (+20%).[/font][/color]

[color=#000000][font=verdana, geneva, lucida,][background=rgb(235, 241, 250)]* Skill mod : Damage modifier. 100% for melee attacks, 140% for critical attacks, 1400% for Cross Impact, 600% for Bash, etc.[/background][/font][/color][/quote]

This post has been edited by MarkZD on Nov 11, 2012 14:59

Hercules Elf Bot - Jul 16, 2012 14:53

Originally posted by [b]Angezerus[/b]
Confirmed. No def bypassing anymore :(

Hercules Elf Bot - Aug 13, 2012 9:05

Originally posted by [b]michieru[/b]
bump

Hercules Elf Bot - Oct 16, 2012 10:37

Originally posted by [b]Angezerus[/b]
/omg

Hercules Elf Bot - Oct 16, 2012 12:45

Originally posted by [b]Spre[/b]
It'll be fixed, no need to bump. Critical also has the following(in another bug report and confirmed) That the crit rate is dependant on the monsters luk rating, the higher the luk rating the more your crit rating is effected

For example with 100 crit against angleing you only actually have a 80 crit rating, as his luk effects it.

Hercules Elf Bot - Oct 17, 2012 4:27

Originally posted by [b]MarkZD[/b]
[quote name='Spre' timestamp='1350391517' post='15008']
Critical also has the following(in another bug report and confirmed) That the crit rate is dependant on the monsters luk rating, the higher the luk rating the more your crit rating is effectedFor example with 100 crit against angleing you only actually have a 80 crit rating, as his luk effects it.
[/quote]

I think it's already working this way, at least it was on Cronus(an emulator which was based on eAthena and rAthena, like years ago), it's called Perfect Dodge(flee which can evade even critical).

This post has been edited by MarkZD on Oct 17, 2012 4:30

Hercules Elf Bot - Oct 18, 2012 8:21

Originally posted by [b]Angezerus[/b]
[quote name='MarkZD' timestamp='1350448034' post='15021']
I think it's already working this way, at least it was on Cronus(an emulator which was based on eAthena and rAthena, like years ago), it's called Perfect Dodge(flee which can evade even critical).
[/quote]

Yup, it was always working this way, so I don't understand O.o

This post has been edited by Angezerus on Oct 18, 2012 8:23

Hercules Elf Bot - Nov 11, 2012 4:59

Originally posted by [b]mkbu95[/b]
So, can anyone confirm if it's working now?

Hercules Elf Bot - Nov 11, 2012 13:29

Originally posted by [b]MarkZD[/b]
Critical is still ignoring defense in the source, but it shouldn't.
src/map/battle.c
[CODE]
if (flag.cri)
{
wd.type = 0x0a;
flag.idef = flag.idef2 = flag.hit = 1;
[/CODE]
Just removing flag.idef && flag.idef2 with ifndef RENEWAL from this condition will fix the ignoring issue.

Perfect Dodge is working fine.
It'll be needed to increase the critical rate damage too.

We can arrange it by just replacing this:
[CODE]
//Add any bonuses that modify the base baseatk+watk (pre-skills)
if(sd) {
if (sd->bonus.atk_rate)
ATK_ADDRATE(sd->bonus.atk_rate);
if(flag.cri && sd->bonus.crit_atk_rate)
ATK_ADDRATE(sd->bonus.crit_atk_rate);
if(sd->status.party_id && (skill=pc_checkskill(sd,TK_POWER)) > 0){
if( (i = party_foreachsamemap(party_sub_count, sd, 0)) > 1 ) // exclude the player himself [Inkfish]
ATK_ADDRATE(2*skill*i);
}
}
[/CODE]
To
[CODE]
//Add any bonuses that modify the base baseatk+watk (pre-skills)
if(sd) {
if (sd->bonus.atk_rate)
ATK_ADDRATE(sd->bonus.atk_rate);
if(flag.cri)
{
#ifdef RENEWAL
if(sd->bonus.crit_atk_rate)
ATK_ADDRATE(40 + sd->bonus.crit_atk_rate);
else
ATK_ADDRATE(40);
#else
if(sd->bonus.crit_atk_rate)
ATK_ADDRATE(sd->bonus.crit_atk_rate);
#endif
}
if(sd->status.party_id && (skill=pc_checkskill(sd,TK_POWER)) > 0){
if( (i = party_foreachsamemap(party_sub_count, sd, 0)) > 1 ) // exclude the player himself [Inkfish]
ATK_ADDRATE(2*skill*i);
}
}
#ifdef RENEWAL
else if(flag.cri)
ATK_ADDRATE(40);
#endif
[/CODE]

This post has been edited by MarkZD on Nov 28, 2012 5:35

Hercules Elf Bot - Nov 27, 2012 12:32

Originally posted by [b]Angezerus[/b]
Bump :) Sry baut dat ;)

Hercules Elf Bot - Dec 20, 2012 0:03

Originally posted by [b]michieru[/b]
Search this:
[CODE]if (flag.cri)
{
wd.type = 0x0a;
flag.idef = flag.idef2 = flag.hit = 1;[/CODE]

replace by this:

[CODE]if (flag.cri)
{
wd.type = 0x0a;
#ifdef RENEWAL
flag.hit = 1;
#esle
flag.idef = flag.idef2 = flag.hit = 1;
#endif[/CODE]

Search this:

[CODE]//Card Fix, sd side
wd.damage = battle_calc_cardfix(BF_WEAPON, src, target, nk, s_ele, s_ele_, wd.damage, 2, wd.flag);
if( flag.lh )
wd.damage2 = battle_calc_cardfix(BF_WEAPON, src, target, nk, s_ele, s_ele_, wd.damage2, 3, wd.flag);

if( skill_num == CR_SHIELDBOOMERANG || skill_num == PA_SHIELDCHAIN )[/CODE]

replace by this

[CODE]//Card Fix, sd side
wd.damage = battle_calc_cardfix(BF_WEAPON, src, target, nk, s_ele, s_ele_, wd.damage, 2, wd.flag);
if( flag.lh )
wd.damage2 = battle_calc_cardfix(BF_WEAPON, src, target, nk, s_ele, s_ele_, wd.damage2, 3, wd.flag);
#ifdef RENEWAL
if(flag.cri)
ATK_ADDRATE(sd->bonus.crit_atk_rate>=100?sd->bonus.crit_atk_rate-60:40);
#endif
if( skill_num == CR_SHIELDBOOMERANG || skill_num == PA_SHIELDCHAIN )[/CODE]

Ind - Apr 16, 2013 3:55

Fixed in [url="https://github.com/HerculesWS/Hercules/commit/370bfb735bb59761cc7b5d2fbe84b6739125c3c4"]https://github.com/HerculesWS/Hercules/commit/370bfb735bb59761cc7b5d2fbe84b6739125c3c4[/url]
Thanks Micheru