Aftercast Delay Cap.

Started by SnowBunny, Jan 12, 2012, 08:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SnowBunny

Recently, I added this to source for a 60% aftercast reduction cap. Somehow, something somewhere went wrong and the aftercast is shakey ranging from 30 - 40%, or around there. If anyone would kindly show me if something is missed out somewhere or someplace.. Thank you very the muchie. :3
Spoiler

int skill_delayfix (struct block_list *bl, int skill_id, int skill_lv)
{
int delaynodex = skill_get_delaynodex(skill_id, skill_lv);
int time = skill_get_delay(skill_id, skill_lv);
struct map_session_data *sd;
struct status_change *sc = status_get_sc(bl);
int min_time; //[Shag] Minimum value you can reduce to.

nullpo_ret(bl);
sd = BL_CAST(BL_PC, bl);

if (skill_id == SA_ABRACADABRA)
return 0; //Will use picked skill's delay.

if (bl->type&battle_config.no_skill_delay)
return battle_config.min_skill_delay_limit;

if (time < 0)
time = -time + status_get_amotion(bl); // If set to <0, add to attack motion.

min_time = time * 60 / 100;

// Delay reductions
switch (skill_id)
  { //Monk combo skills have their delay reduced by agi/dex.
case MO_TRIPLEATTACK:
case MO_CHAINCOMBO:
case MO_COMBOFINISH:
case CH_TIGERFIST:
case CH_CHAINCRUSH:
time -= 4*status_get_agi(bl) - 2*status_get_dex(bl);
break;
case HP_BASILICA:
if( sc && !sc->data[SC_BASILICA] )
time = 0; // There is no Delay on Basilica creation, only on cancel
break;
default:
if (battle_config.delay_dependon_dex && !(delaynodex&1))
{ // if skill delay is allowed to be reduced by dex
int scale = battle_config.castrate_dex_scale - status_get_dex(bl);
if (scale > 0)
time = time * scale / battle_config.castrate_dex_scale;
else //To be capped later to minimum.
time = 0;
}
if (battle_config.delay_dependon_agi && !(delaynodex&1))
{ // if skill delay is allowed to be reduced by agi
int scale = battle_config.castrate_dex_scale - status_get_agi(bl);
if (scale > 0)
time = time * scale / battle_config.castrate_dex_scale;
else //To be capped later to minimum.
time = 0;
}
}

if ( sc && sc->data[SC_SPIRIT] )
{
switch (skill_id) {
case CR_SHIELDBOOMERANG:
if (sc->data[SC_SPIRIT]->val2 == SL_CRUSADER)
time /= 2;
break;
case AS_SONICBLOW:
if (!map_flag_gvg(bl->m) && !map[bl->m].flag.battleground && sc->data[SC_SPIRIT]->val2 == SL_ASSASIN)
time /= 2;
break;
}
}

if (!(delaynodex&2))
{
if (sc && sc->count) {
if (sc->data[SC_POEMBRAGI])
time -= time * sc->data[SC_POEMBRAGI]->val3 / 100;
}
}

if( !(delaynodex&4) && sd && sd->delayrate != 100 )
time = time * sd->delayrate / 100;

time = max(time,min_time); //[Shag] do the actual check for the min delay reduction

if (battle_config.delay_rate != 100)
time = time * battle_config.delay_rate / 100;

if (time < status_get_amotion(bl))
time = status_get_amotion(bl); // Delay can never be below amotion [Playtester]

return max(time, battle_config.min_skill_delay_limit);
}


[close]


Look Adelie! Look! Stupid people! Stupid people everywhere!

Triper

Tested with 40 instead of 60?
If you're getting 40% instead of 60% it looks to me that you are playing with something that is working with 100-(x*y) where your y = 60 so if x = 100 you get a 40.

PS - No, I didn't check the code, just read the start of the topic and though that.