Issue information

Issue ID
#6604
Status
Fixed
Severity
Fair
Started
Hercules Elf Bot
Sep 2, 2012 5:29
Last Post
malufett
Jun 12, 2013 19:04
Confirmation
N/A

Hercules Elf Bot - Sep 2, 2012 5:29

Originally posted by [b]Rytech[/b]
A while ago I had someone complain to me that AGI wasnt affecting the skill at all even with like 120 AGI. After checking the formula I found why....

[CODE]
case BA_ASSASSINCROSS:
val1 = 100+(10*skilllv)+(status->agi/10); // ASPD increase
[/CODE]

I found a bug report that claimed it was incorrect before that divide by 10 was added which also showed a incorrect understanding of how ASPD is handled.

http://rathena.org/board/tracker/issue-4631-impressive-riff-incorrect-script/

Here's how ASPD is handled as found in status.c
/// Calculates an object's ASPD modifier (alters the base amotion value).
/// Note that the scale of aspd_rate is 1000 = 100%.

So that means 10 AGI would be 1% or 1.0%. The value works in a way where 250 would equal 25.0% and 1000 would equal 100.0% for example. So the correct formula is the old which was....

[CODE]
val1 = 100+(10*skilllv)+(status->agi); // ASPD increase
[/CODE]

Hercules Elf Bot - Sep 2, 2012 13:55

Originally posted by [b]malufett[/b]
no actually the formula is correct...

but this is really the problem
[CODE]

if(sc->data[SC_ASSNCROS] &&
max < sc->data[SC_ASSNCROS]->val2)
{
if (bl->type!=BL_PC)
max = sc->data[SC_ASSNCROS]->val2;
else
switch(((TBL_PC*)bl)->status.weapon)
{
case W_BOW:
case W_REVOLVER:
case W_RIFLE:
case W_GATLING:
case W_SHOTGUN:
case W_GRENADE:
break;
default:
max = sc->data[SC_ASSNCROS]->val2;
}
}
[/CODE]

val2 should be multiplied by 10...
but if you want to use your suggested formula it suppose to be
[CODE]val1 = 1000+(100*skilllv)+(status->agi); // ASPD increase[/CODE]

:meow:

This post has been edited by malufett on Sep 2, 2012 14:07

Hercules Elf Bot - Sep 2, 2012 15:16

Originally posted by [b]Rytech[/b]
Ehhhh.....what does val2 do? Shouldnt we be looking at val1?

[CODE]
if(sc->data[SC_ASSNCROS] &&
skills1 < 5+1*sc->data[SC_ASSNCROS]->val1) // needs more info
{
if (bl->type!=BL_PC)
skills1 = 4+1*sc->data[SC_ASSNCROS]->val1;
else
switch(((TBL_PC*)bl)->status.weapon)
{
case W_BOW:
case W_REVOLVER:
case W_RIFLE:
case W_GATLING:
case W_SHOTGUN:
case W_GRENADE:
break;
default:
skills1 = 5+1*sc->data[SC_ASSNCROS]->val1;
}
}
[/CODE]

This post has been edited by Rytech on Sep 2, 2012 15:35

Hercules Elf Bot - Sep 2, 2012 15:35

Originally posted by [b]malufett[/b]
that is the val1 from skill.c and convert to val2..because of this
[CODE]sc_start4(bl,type,100,sg->skill_lv,sg->val1,sg->val2,0,sg->limit);[/CODE]

:meow:

Hercules Elf Bot - Sep 2, 2012 15:38

Originally posted by [b]Rytech[/b]
So val2 takes val1's value, val3 takes val2's value.....wtf is this? Im really confused now. /heh

Hercules Elf Bot - Sep 2, 2012 15:46

Originally posted by [b]malufett[/b]
hahaha..here I'll gonna explain to you..

the val1 from skill.c is different from the val1 of status.c

the val1 in the skill.c is used for the skill_unit_group..
so this value is use for other value except the skill level since skill_unit_group has a different variable for that...

and status_change general usage of val1 is for skill level so they move it to val2..

so here for more clearer view...


[CODE]
case UNT_WHISTLE:
case UNT_ASSASSINCROSS:
case UNT_POEMBRAGI:
case UNT_APPLEIDUN:
case UNT_HUMMING:
case UNT_DONTFORGETME:
case UNT_FORTUNEKISS:
case UNT_SERVICEFORYOU:
if (sg->src_id==bl->id && !(sc && sc->data[SC_SPIRIT] && sc->data[SC_SPIRIT]->val2 == SL_BARDDANCER)) {
if( sce )/* We have the status but we're not elegible for it, so we take it away. (bugreport:4591) */
sce->val4 = 2;
return 0;
}
if (!sc) return 0;
if (!sce)
sc_start4(bl,type,100,sg->skill_lv,sg->val1,sg->val2,0,sg->limit);
else if (sce->val4 == 1) {
//Readjust timers since the effect will not last long.
sce->val4 = 0;
delete_timer(sce->timer, status_change_timer);
sce->timer = add_timer(tick+sg->limit, status_change_timer, bl->id, type);
}
break;[/CODE]

Hercules Elf Bot - Sep 2, 2012 15:54

Originally posted by [b]Rytech[/b]
Think I understand now........MAAAAAAYBE. Wow so complex.

Hercules Elf Bot - Sep 2, 2012 16:11

Originally posted by [b]malufett[/b]
[quote]Think I understand now........MAAAAAAYBE. Wow so complex.[/quote]
well that is how it was implemented.. ^_^

btw regarding this one
[CODE] skills1 = 5+1*sc->data[SC_ASSNCROS]->val1;[/CODE]

I use the val1 as skill level and not the suggested formula since I don't know its aspd increase in kro renewal...

and you may commit the fix by multiplying val2 by 10 in status.c... /no1
:meow:

Hercules Elf Bot - Dec 1, 2012 12:52

Originally posted by [b]Angezerus[/b]
Was this fixed?

Hercules Elf Bot - Dec 20, 2012 4:49

Originally posted by [b]donkeyg[/b]
was this fixed?

Hercules Elf Bot - Dec 21, 2012 15:08

Originally posted by [b]donkeyg[/b]
any solution?

Hercules Elf Bot - Dec 22, 2012 7:09

Originally posted by [b]donkeyg[/b]
........... bump?

malufett - Jun 12, 2013 19:04

Fixed @ 0395610469ffcd3b71c93ef90861f73e0ab8d16f
:meow: