Implemented Renewal Casting System.
Fixed bugreport:2018 where CH_PALMSTRIKE deals damage to hidden targets. Fixed bugreport:6473, bugreport:6325 SC_DEADLYINFECT should now spread status ailments properly. Fixed bugreport:5541, bugreport:6179, bugreport:6281 where self buff skill is transfer to targets when doing a combo. Updated AC_VULTURE where in renewal it doesn't show the hit bonus anymore in the status window. git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16661 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
c3ad10e3dd
commit
ed4b36e5f4
@ -429,7 +429,9 @@ bonus2 bSPGainRaceAttack,x,n; Heals n SP when attacking x Race on every hit
|
|||||||
bonus2 bSkillUseSPrate,s,x; Reduces SP consumption of skill s by x%. (supports skill names.)
|
bonus2 bSkillUseSPrate,s,x; Reduces SP consumption of skill s by x%. (supports skill names.)
|
||||||
bonus2 bSkillUseSP,s,x; Reduces SP consumption of skill s by x. (supports skill names.)
|
bonus2 bSkillUseSP,s,x; Reduces SP consumption of skill s by x. (supports skill names.)
|
||||||
bonus2 bSkillCooldown,s,x; Increases cooldown of skill s by x milliseconds. (supports skill names.)
|
bonus2 bSkillCooldown,s,x; Increases cooldown of skill s by x milliseconds. (supports skill names.)
|
||||||
bonus2 bSkillFixedCast,s,x; Increases fixed cast time of skill s by x milliseconds. (supports skill names.)
|
|
||||||
bonus2 bSkillVariableCast,s,x; Increases variable cast time of skill s by x milliseconds. (supports skill names.) [Pending!]
|
|
||||||
bonus bFixedCastrate,x; Increases fixed cast time of skills by x%.
|
bonus bFixedCastrate,x; Increases fixed cast time of skills by x%.
|
||||||
bonus bVariableCastrate,x; Increases variable cast time of skills x%. [Pending!]
|
bonus bVariableCastrate,x; Increases variable cast time of skills by x%.
|
||||||
|
bonus2 bSkillFixedCast,s,x; Increases fixed cast time of skill s by x milliseconds. (supports skill names.)
|
||||||
|
bonus2 bSkillVariableCast,s,x; Increases variable cast time of skill s by x milliseconds. (supports skill names.)
|
||||||
|
bonus2 bVariableCastrate,s,x; Increases variable cast time of skill s by x%. (supports skill names.)
|
@ -3574,9 +3574,8 @@ The renewal feature to check is determined by type.
|
|||||||
2 - RENEWAL_DROP (renewal drop rate algorithms)
|
2 - RENEWAL_DROP (renewal drop rate algorithms)
|
||||||
3 - RENEWAL_EXP (renewal exp rate algorithms)
|
3 - RENEWAL_EXP (renewal exp rate algorithms)
|
||||||
4 - RENEWAL_LVDMG (renewal level modifier on damage)
|
4 - RENEWAL_LVDMG (renewal level modifier on damage)
|
||||||
5 - RENEWAL_CAST_VMIN (renewal cast time variable cast requirement)
|
5 - RENEWAL_EDP (renewal enchant deadly poison algorithm)
|
||||||
6 - RENEWAL_EDP (renewal enchant deadly poison algorithm)
|
6 - RENEWAL_ASPD (renewal ASPD)
|
||||||
7 - RENEWAL_ASPD (renewal ASPD)
|
|
||||||
|
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
\\
|
\\
|
||||||
|
@ -12,28 +12,6 @@
|
|||||||
* @INFO: This file holds constants that aims at making code smoother and more efficient
|
* @INFO: This file holds constants that aims at making code smoother and more efficient
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* "Constants"
|
|
||||||
**/
|
|
||||||
#ifdef RENEWAL_CAST
|
|
||||||
|
|
||||||
#ifndef RENEWAL
|
|
||||||
#error RENEWAL_CAST requires RENEWAL enabled
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CONST_CASTRATE_SCALE RENEWAL_CAST_VMIN
|
|
||||||
/**
|
|
||||||
* Cast Rate Formula: (DEX x 2)+INT
|
|
||||||
**/
|
|
||||||
#define CONST_CASTRATE_CALC ((status_get_dex(bl)*2)+status_get_int(bl))
|
|
||||||
#else
|
|
||||||
#define CONST_CASTRATE_SCALE battle_config.castrate_dex_scale
|
|
||||||
/**
|
|
||||||
* Cast Rate Formula: (DEX)
|
|
||||||
**/
|
|
||||||
#define CONST_CASTRATE_CALC (status_get_dex(bl))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* "Sane Checks" to save you from compiling with cool bugs
|
* "Sane Checks" to save you from compiling with cool bugs
|
||||||
**/
|
**/
|
||||||
@ -108,6 +86,13 @@
|
|||||||
#define MAX_CARTS 5
|
#define MAX_CARTS 5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Renewal variable cast time reduction
|
||||||
|
#ifdef RENEWAL_CAST
|
||||||
|
#define VARCAST_REDUCTION(val){ \
|
||||||
|
if( (varcast_r += val) != 0 && varcast_r >= 0 ) \
|
||||||
|
time = time * (1 - (float)min(val, 100) / 100); \
|
||||||
|
}
|
||||||
|
#endif
|
||||||
/**
|
/**
|
||||||
* End of File
|
* End of File
|
||||||
**/
|
**/
|
||||||
|
@ -49,13 +49,6 @@
|
|||||||
// leave this line to enable renewal base level modifier on skill damage (selected skills only)
|
// leave this line to enable renewal base level modifier on skill damage (selected skills only)
|
||||||
#define RENEWAL_LVDMG
|
#define RENEWAL_LVDMG
|
||||||
|
|
||||||
/// renewal cast time variable cast requirement
|
|
||||||
///
|
|
||||||
/// this is the value required for no variable cast-time with stats.
|
|
||||||
/// formula: (DEX * 2) + INT
|
|
||||||
/// default: 530
|
|
||||||
#define RENEWAL_CAST_VMIN 530
|
|
||||||
|
|
||||||
/// renewal enchant deadly poison algorithm
|
/// renewal enchant deadly poison algorithm
|
||||||
///
|
///
|
||||||
/// leave this line to enable the renewed EDP algorithm
|
/// leave this line to enable the renewed EDP algorithm
|
||||||
|
@ -1587,6 +1587,10 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
|
|||||||
|
|
||||||
if(sd && flag.arrow)
|
if(sd && flag.arrow)
|
||||||
hitrate += sd->bonus.arrow_hit;
|
hitrate += sd->bonus.arrow_hit;
|
||||||
|
#ifdef RENEWAL
|
||||||
|
if( sd ) //in Renewal hit bonus from Vultures Eye is not anymore shown in status window
|
||||||
|
hitrate += pc_checkskill(sd,AC_VULTURE);
|
||||||
|
#endif
|
||||||
if(skill_num)
|
if(skill_num)
|
||||||
switch(skill_num)
|
switch(skill_num)
|
||||||
{ //Hit skill modifiers
|
{ //Hit skill modifiers
|
||||||
@ -4258,6 +4262,10 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
|
|||||||
}
|
}
|
||||||
|
|
||||||
hitrate+= sstatus->hit - flee;
|
hitrate+= sstatus->hit - flee;
|
||||||
|
#ifdef RENEWAL
|
||||||
|
if( sd ) //in Renewal hit bonus from Vultures Eye is not anymore shown in status window
|
||||||
|
hitrate += pc_checkskill(sd,AC_VULTURE);
|
||||||
|
#endif
|
||||||
hitrate = cap_value(hitrate, battle_config.min_hitrate, battle_config.max_hitrate);
|
hitrate = cap_value(hitrate, battle_config.min_hitrate, battle_config.max_hitrate);
|
||||||
|
|
||||||
if(rnd()%100 < hitrate)
|
if(rnd()%100 < hitrate)
|
||||||
@ -4676,6 +4684,12 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
|
|||||||
skill_get_time(MO_CALLSPIRITS, sc->data[SC_GT_ENERGYGAIN]->val1),
|
skill_get_time(MO_CALLSPIRITS, sc->data[SC_GT_ENERGYGAIN]->val1),
|
||||||
sc->data[SC_GT_ENERGYGAIN]->val1);
|
sc->data[SC_GT_ENERGYGAIN]->val1);
|
||||||
}
|
}
|
||||||
|
if( tsc && tsc->data[SC_GT_ENERGYGAIN] ) {
|
||||||
|
if( tsd && rnd()%100 < 10 + 5 * tsc->data[SC_GT_ENERGYGAIN]->val1)
|
||||||
|
pc_addspiritball(tsd,
|
||||||
|
skill_get_time(MO_CALLSPIRITS, tsc->data[SC_GT_ENERGYGAIN]->val1),
|
||||||
|
tsc->data[SC_GT_ENERGYGAIN]->val1);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5577,6 +5591,7 @@ static const struct _battle_data {
|
|||||||
{ "max_cloth_color", &battle_config.max_cloth_color, 4, 0, INT_MAX, },
|
{ "max_cloth_color", &battle_config.max_cloth_color, 4, 0, INT_MAX, },
|
||||||
{ "pet_hair_style", &battle_config.pet_hair_style, 100, 0, INT_MAX, },
|
{ "pet_hair_style", &battle_config.pet_hair_style, 100, 0, INT_MAX, },
|
||||||
{ "castrate_dex_scale", &battle_config.castrate_dex_scale, 150, 1, INT_MAX, },
|
{ "castrate_dex_scale", &battle_config.castrate_dex_scale, 150, 1, INT_MAX, },
|
||||||
|
{ "vcast_stat_scale", &battle_config.vcast_stat_scale, 530, 1, INT_MAX, },
|
||||||
{ "area_size", &battle_config.area_size, 14, 0, INT_MAX, },
|
{ "area_size", &battle_config.area_size, 14, 0, INT_MAX, },
|
||||||
{ "zeny_from_mobs", &battle_config.zeny_from_mobs, 0, 0, 1, },
|
{ "zeny_from_mobs", &battle_config.zeny_from_mobs, 0, 0, 1, },
|
||||||
{ "mobs_level_up", &battle_config.mobs_level_up, 0, 0, 1, },
|
{ "mobs_level_up", &battle_config.mobs_level_up, 0, 0, 1, },
|
||||||
|
@ -473,6 +473,7 @@ extern struct Battle_Config
|
|||||||
int max_baby_third_parameter;
|
int max_baby_third_parameter;
|
||||||
int atcommand_max_stat_bypass;
|
int atcommand_max_stat_bypass;
|
||||||
int max_third_aspd;
|
int max_third_aspd;
|
||||||
|
int vcast_stat_scale;
|
||||||
|
|
||||||
int mvp_tomb_enabled;
|
int mvp_tomb_enabled;
|
||||||
|
|
||||||
|
20
src/map/pc.c
20
src/map/pc.c
@ -2599,11 +2599,11 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
|
|||||||
break;
|
break;
|
||||||
case SP_FIXCASTRATE:
|
case SP_FIXCASTRATE:
|
||||||
if(sd->state.lr_flag != 2)
|
if(sd->state.lr_flag != 2)
|
||||||
sd->fixcastrate+=val;
|
sd->bonus.fixcastrate -= val;
|
||||||
break;
|
break;
|
||||||
case SP_VARCASTRATE:
|
case SP_VARCASTRATE:
|
||||||
if(sd->state.lr_flag != 2)
|
if(sd->state.lr_flag != 2)
|
||||||
sd->varcastrate+=val;
|
sd->bonus.varcastrate -= val;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ShowWarning("pc_bonus: unknown type %d %d !\n",type,val);
|
ShowWarning("pc_bonus: unknown type %d %d !\n",type,val);
|
||||||
@ -3135,6 +3135,22 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
|
|||||||
sd->skillvarcast[i].val = val;
|
sd->skillvarcast[i].val = val;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case SP_VARCASTRATE:
|
||||||
|
if(sd->state.lr_flag == 2)
|
||||||
|
break;
|
||||||
|
ARR_FIND(0, ARRAYLENGTH(sd->skillcast), i, sd->skillcast[i].id == 0 || sd->skillcast[i].id == type2);
|
||||||
|
if (i == ARRAYLENGTH(sd->skillcast))
|
||||||
|
{
|
||||||
|
ShowDebug("run_script: bonus2 bVariableCastrate reached it's limit (%d skills per character), bonus skill %d (+%d%%) lost.\n",ARRAYLENGTH(sd->skillcast), type2, val);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(sd->skillcast[i].id == type2)
|
||||||
|
sd->skillcast[i].val -= val;
|
||||||
|
else {
|
||||||
|
sd->skillcast[i].id = type2;
|
||||||
|
sd->skillcast[i].val -= val;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case SP_SKILL_USE_SP: //bonus2 bSkillUseSP,n,x;
|
case SP_SKILL_USE_SP: //bonus2 bSkillUseSP,n,x;
|
||||||
if(sd->state.lr_flag == 2)
|
if(sd->state.lr_flag == 2)
|
||||||
break;
|
break;
|
||||||
|
@ -317,11 +317,12 @@ struct map_session_data {
|
|||||||
unsigned short unbreakable; // chance to prevent ANY equipment breaking [celest]
|
unsigned short unbreakable; // chance to prevent ANY equipment breaking [celest]
|
||||||
unsigned short unbreakable_equip; //100% break resistance on certain equipment
|
unsigned short unbreakable_equip; //100% break resistance on certain equipment
|
||||||
unsigned short unstripable_equip;
|
unsigned short unstripable_equip;
|
||||||
|
int fixcastrate,varcastrate;
|
||||||
} bonus;
|
} bonus;
|
||||||
|
|
||||||
// zeroed vars end here.
|
// zeroed vars end here.
|
||||||
|
|
||||||
int castrate,delayrate,hprate,sprate,dsprate,fixcastrate,varcastrate;
|
int castrate,delayrate,hprate,sprate,dsprate;
|
||||||
int hprecov_rate,sprecov_rate;
|
int hprecov_rate,sprecov_rate;
|
||||||
int matk_rate;
|
int matk_rate;
|
||||||
int critical_rate,hit_rate,flee_rate,flee2_rate,def_rate,def2_rate,mdef_rate,mdef2_rate;
|
int critical_rate,hit_rate,flee_rate,flee2_rate,def_rate,def2_rate,mdef_rate,mdef2_rate;
|
||||||
|
@ -7718,6 +7718,7 @@ BUILDIN_FUNC(bonus)
|
|||||||
case SP_SKILL_COOLDOWN:
|
case SP_SKILL_COOLDOWN:
|
||||||
case SP_SKILL_FIXEDCAST:
|
case SP_SKILL_FIXEDCAST:
|
||||||
case SP_SKILL_VARIABLECAST:
|
case SP_SKILL_VARIABLECAST:
|
||||||
|
case SP_VARCASTRATE:
|
||||||
case SP_SKILL_USE_SP:
|
case SP_SKILL_USE_SP:
|
||||||
// these bonuses support skill names
|
// these bonuses support skill names
|
||||||
val1 = ( script_isstring(st,3) ? skill_name2id(script_getstr(st,3)) : script_getnum(st,3) );
|
val1 = ( script_isstring(st,3) ? skill_name2id(script_getstr(st,3)) : script_getnum(st,3) );
|
||||||
@ -16886,20 +16887,13 @@ BUILDIN_FUNC(checkre)
|
|||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
#ifdef RENEWAL_CAST_VMIN
|
|
||||||
script_pushint(st, 1);
|
|
||||||
#else
|
|
||||||
script_pushint(st, 0);
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
#ifdef RENEWAL_EDP
|
#ifdef RENEWAL_EDP
|
||||||
script_pushint(st, 1);
|
script_pushint(st, 1);
|
||||||
#else
|
#else
|
||||||
script_pushint(st, 0);
|
script_pushint(st, 0);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 6:
|
||||||
#ifdef RENEWAL_ASPD
|
#ifdef RENEWAL_ASPD
|
||||||
script_pushint(st, 1);
|
script_pushint(st, 1);
|
||||||
#else
|
#else
|
||||||
|
141
src/map/skill.c
141
src/map/skill.c
@ -39,6 +39,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
|
||||||
#define SKILLUNITTIMER_INTERVAL 100
|
#define SKILLUNITTIMER_INTERVAL 100
|
||||||
@ -3183,6 +3184,14 @@ static int skill_timerskill(int tid, unsigned int tick, int id, intptr_t data)
|
|||||||
map_foreachinrange(skill_area_sub, target, skill_get_splash(skl->skill_id, skl->skill_lv), BL_CHAR,
|
map_foreachinrange(skill_area_sub, target, skill_get_splash(skl->skill_id, skl->skill_lv), BL_CHAR,
|
||||||
src, skl->skill_id, skl->skill_lv, 0, skl->flag|1|BCT_ENEMY, skill_castend_damage_id);
|
src, skl->skill_id, skl->skill_lv, 0, skl->flag|1|BCT_ENEMY, skill_castend_damage_id);
|
||||||
break;
|
break;
|
||||||
|
case CH_PALMSTRIKE:
|
||||||
|
{
|
||||||
|
struct status_change* tsc = status_get_sc(target);
|
||||||
|
if( tsc && tsc->option&OPTION_HIDE ){
|
||||||
|
skill_blown(src,target,skill_get_blewcount(skl->skill_id, skl->skill_lv), -1, 0x0 );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
skill_attack(skl->type,src,src,target,skl->skill_id,skl->skill_lv,tick,skl->flag);
|
skill_attack(skl->type,src,src,target,skl->skill_id,skl->skill_lv,tick,skl->flag);
|
||||||
break;
|
break;
|
||||||
@ -13353,12 +13362,12 @@ int skill_castfix (struct block_list *bl, int skill_id, int skill_lv)
|
|||||||
|
|
||||||
nullpo_ret(bl);
|
nullpo_ret(bl);
|
||||||
sd = BL_CAST(BL_PC, bl);
|
sd = BL_CAST(BL_PC, bl);
|
||||||
|
#ifndef RENEWAL_CAST
|
||||||
// calculate base cast time (reduced by dex)
|
// calculate base cast time (reduced by dex)
|
||||||
if( !(skill_get_castnodex(skill_id, skill_lv)&1) ) {
|
if( !(skill_get_castnodex(skill_id, skill_lv)&1) ) {
|
||||||
int scale = CONST_CASTRATE_SCALE - CONST_CASTRATE_CALC;
|
int scale = battle_config.castrate_dex_scale - status_get_dex(bl);
|
||||||
if( scale > 0 ) // not instant cast
|
if( scale > 0 ) // not instant cast
|
||||||
time = time * scale / CONST_CASTRATE_SCALE;
|
time = time * scale / battle_config.castrate_dex_scale;
|
||||||
else
|
else
|
||||||
return 0; // instant cast
|
return 0; // instant cast
|
||||||
}
|
}
|
||||||
@ -13378,6 +13387,7 @@ int skill_castfix (struct block_list *bl, int skill_id, int skill_lv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
// config cast time multiplier
|
// config cast time multiplier
|
||||||
if (battle_config.cast_rate != 100)
|
if (battle_config.cast_rate != 100)
|
||||||
time = time * battle_config.cast_rate / 100;
|
time = time * battle_config.cast_rate / 100;
|
||||||
@ -13388,70 +13398,117 @@ int skill_castfix (struct block_list *bl, int skill_id, int skill_lv)
|
|||||||
/*==========================================
|
/*==========================================
|
||||||
* Does cast-time reductions based on sc data.
|
* Does cast-time reductions based on sc data.
|
||||||
*------------------------------------------*/
|
*------------------------------------------*/
|
||||||
int skill_castfix_sc (struct block_list *bl, int time, int skill_id, int skill_lv) {
|
int skill_castfix_sc (struct block_list *bl, int time)
|
||||||
|
{
|
||||||
struct status_change *sc = status_get_sc(bl);
|
struct status_change *sc = status_get_sc(bl);
|
||||||
#ifdef RENEWAL_CAST
|
|
||||||
struct map_session_data *sd = BL_CAST(BL_PC,bl);
|
if( time < 0 )
|
||||||
int fixed = skill_get_fixed_cast(skill_id, skill_lv);
|
return 0;
|
||||||
if( !fixed ) {
|
|
||||||
fixed = skill_get_cast(skill_id, skill_lv);
|
|
||||||
fixed = ( fixed > 1 ? ( fixed * 20 / 100 ) : 0 );
|
|
||||||
}
|
|
||||||
if(sd){// Increases/Decreases fixed cast time of a skill by item/card bonuses.
|
|
||||||
int i;
|
|
||||||
if( sd->fixcastrate != 100 )
|
|
||||||
fixed = fixed * sd->fixcastrate / 100;
|
|
||||||
for (i = 0; i < ARRAYLENGTH(sd->skillfixcast) && sd->skillfixcast[i].id; i++) {
|
|
||||||
if (sd->skillfixcast[i].id == skill_id){
|
|
||||||
fixed += sd->skillfixcast[i].val;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if( time < 0 ) return 0; // due to fixed castime so use -1 to nullify the casting. [malufett]
|
|
||||||
if (sc && sc->count) {
|
if (sc && sc->count) {
|
||||||
if (sc->data[SC_SLOWCAST])
|
if (sc->data[SC_SLOWCAST])
|
||||||
time += time * sc->data[SC_SLOWCAST]->val2 / 100;
|
time += time * sc->data[SC_SLOWCAST]->val2 / 100;
|
||||||
if (sc->data[SC_SUFFRAGIUM]) {
|
if (sc->data[SC_SUFFRAGIUM]) {
|
||||||
time -= time * sc->data[SC_SUFFRAGIUM]->val2 / 100;
|
time -= time * sc->data[SC_SUFFRAGIUM]->val2 / 100;
|
||||||
status_change_end(bl, SC_SUFFRAGIUM, INVALID_TIMER);
|
status_change_end(bl, SC_SUFFRAGIUM, -1);
|
||||||
}
|
}
|
||||||
if (sc->data[SC_MEMORIZE]) {
|
if (sc->data[SC_MEMORIZE]) {
|
||||||
time>>=1;
|
time>>=1;
|
||||||
if ((--sc->data[SC_MEMORIZE]->val2) <= 0)
|
if ((--sc->data[SC_MEMORIZE]->val2) <= 0)
|
||||||
status_change_end(bl, SC_MEMORIZE, INVALID_TIMER);
|
status_change_end(bl, SC_MEMORIZE, -1);
|
||||||
}
|
}
|
||||||
if (sc->data[SC_POEMBRAGI])
|
if (sc->data[SC_POEMBRAGI])
|
||||||
time -= time * sc->data[SC_POEMBRAGI]->val2 / 100;
|
time -= time * sc->data[SC_POEMBRAGI]->val2 / 100;
|
||||||
if (sc->data[SC_IZAYOI])
|
if (sc->data[SC_IZAYOI])
|
||||||
time -= time * 50 / 100;
|
time -= time * 50 / 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (time > 0) ? time : 0;
|
||||||
|
}
|
||||||
#ifdef RENEWAL_CAST
|
#ifdef RENEWAL_CAST
|
||||||
|
int skill_vfcastfix (struct block_list *bl, double time, int skill_id, int skill_lv)
|
||||||
|
{
|
||||||
|
struct status_change *sc = status_get_sc(bl);
|
||||||
|
struct map_session_data *sd = BL_CAST(BL_PC,bl);
|
||||||
|
int fixed = skill_get_fixed_cast(skill_id, skill_lv), fixcast_r = 0, varcast_r = 0, i = 0;
|
||||||
|
|
||||||
|
if( time < 0 )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if( !fixed )
|
||||||
|
fixed = (int)time * 20 / 100; // fixed time
|
||||||
|
time = time * 80 / 100; // variable time
|
||||||
|
|
||||||
|
if(sd && !(skill_get_castnodex(skill_id, skill_lv)&4) ){ // Increases/Decreases fixed/variable cast time of a skill by item/card bonuses.
|
||||||
|
if( sd->bonus.varcastrate < 0 )
|
||||||
|
VARCAST_REDUCTION(sd->bonus.varcastrate);
|
||||||
|
for (i = 0; i < ARRAYLENGTH(sd->skillfixcast) && sd->skillfixcast[i].id; i++)
|
||||||
|
if (sd->skillfixcast[i].id == skill_id){ // bonus2 bSkillFixedCast
|
||||||
|
fixed += sd->skillfixcast[i].val;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
for( i = 0; i < ARRAYLENGTH(sd->skillvarcast) && sd->skillvarcast[i].id; i++ )
|
||||||
|
if( sd->skillvarcast[i].id == skill_id ){ // bonus2 bSkillVariableCast
|
||||||
|
time += sd->skillvarcast[i].val;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
for( i = 0; i < ARRAYLENGTH(sd->skillcast) && sd->skillcast[i].id; i++ )
|
||||||
|
if( sd->skillcast[i].id == skill_id ){ // bonus2 bVariableCastrate
|
||||||
|
if( (i=sd->skillcast[i].val) < 0)
|
||||||
|
VARCAST_REDUCTION(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sc && sc->count && !(skill_get_castnodex(skill_id, skill_lv)&2) ) {
|
||||||
|
// All variable cast additive bonuses must come first
|
||||||
|
if (sc->data[SC_SLOWCAST])
|
||||||
|
VARCAST_REDUCTION(-sc->data[SC_SLOWCAST]->val2);
|
||||||
|
|
||||||
|
// Variable cast reduction bonuses
|
||||||
|
if (sc->data[SC_SUFFRAGIUM]) {
|
||||||
|
VARCAST_REDUCTION(sc->data[SC_SUFFRAGIUM]->val2);
|
||||||
|
status_change_end(bl, SC_SUFFRAGIUM, INVALID_TIMER);
|
||||||
|
}
|
||||||
|
if (sc->data[SC_MEMORIZE]) {
|
||||||
|
VARCAST_REDUCTION(50);
|
||||||
|
if ((--sc->data[SC_MEMORIZE]->val2) <= 0)
|
||||||
|
status_change_end(bl, SC_MEMORIZE, INVALID_TIMER);
|
||||||
|
}
|
||||||
|
if (sc->data[SC_POEMBRAGI])
|
||||||
|
VARCAST_REDUCTION(sc->data[SC_POEMBRAGI]->val2);
|
||||||
|
if (sc->data[SC_IZAYOI])
|
||||||
|
VARCAST_REDUCTION(50);
|
||||||
|
// Fixed cast reduction bonuses
|
||||||
if( sc->data[SC__LAZINESS] )
|
if( sc->data[SC__LAZINESS] )
|
||||||
fixed += fixed * sc->data[SC__LAZINESS]->val2 / 100;
|
fixcast_r = max(fixcast_r, sc->data[SC__LAZINESS]->val2);
|
||||||
/**
|
|
||||||
* AB Sacrament reduces fixed cast time by (10 x Level)% (up to 50%)
|
|
||||||
**/
|
|
||||||
if( sc->data[SC_SECRAMENT] )
|
if( sc->data[SC_SECRAMENT] )
|
||||||
fixed -= fixed * sc->data[SC_SECRAMENT]->val2 / 100;
|
fixcast_r = max(fixcast_r, sc->data[SC_SECRAMENT]->val2);
|
||||||
|
if( sd && ( skill_lv = pc_checkskill(sd, WL_RADIUS) ) && skill_id >= WL_WHITEIMPRISON && skill_id <= WL_FREEZE_SP )
|
||||||
|
fixcast_r = max(fixcast_r, 5 + skill_lv * 5);
|
||||||
|
// Fixed cast non percentage bonuses
|
||||||
if( sc->data[SC_MANDRAGORA] && (skill_id >= SM_BASH && skill_id <= RETURN_TO_ELDICASTES) )
|
if( sc->data[SC_MANDRAGORA] && (skill_id >= SM_BASH && skill_id <= RETURN_TO_ELDICASTES) )
|
||||||
fixed += 2000;
|
fixed += 2000;
|
||||||
if (sc->data[SC_IZAYOI] && (skill_id >= NJ_TOBIDOUGU && skill_id <= NJ_ISSEN))
|
if (sc->data[SC_IZAYOI] && (skill_id >= NJ_TOBIDOUGU && skill_id <= NJ_ISSEN))
|
||||||
fixed = 0;
|
fixed = 0;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#ifdef RENEWAL_CAST
|
|
||||||
/**
|
if( sd && !(skill_get_castnodex(skill_id, skill_lv)&4) ){
|
||||||
* WL_RADIUS decreases 10/15/20% fixed cast time from warlock skills
|
VARCAST_REDUCTION( max(sd->bonus.varcastrate, 0) + max(i, 0) );
|
||||||
**/
|
fixcast_r = max(fixcast_r, sd->bonus.fixcastrate) + min(sd->bonus.fixcastrate,0);
|
||||||
if( sd && skill_id >= WL_WHITEIMPRISON && skill_id <= WL_FREEZE_SP && ( skill_lv = pc_checkskill(sd, WL_RADIUS) ) )
|
|
||||||
fixed -= fixed * (5+(skill_lv*5)) / 100;
|
|
||||||
return (time > 0 || fixed > 0) ? cap_value( time , fixed , INT_MAX ) : 0;
|
|
||||||
#else
|
|
||||||
return (time > 0) ? time : 0;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( varcast_r < 0 ) // now compute overall factors
|
||||||
|
time = time * (1 - (float)varcast_r / 100);
|
||||||
|
if( !(skill_get_castnodex(skill_id, skill_lv)&1) )// reduction from status point
|
||||||
|
time = (1 - sqrt( ((float)(status_get_dex(bl)*2 + status_get_int(bl)) / battle_config.vcast_stat_scale) )) * time;
|
||||||
|
// underflow checking/capping
|
||||||
|
time = max(time, 0) + (1 - (float)min(fixcast_r, 100) / 100) * fixed;
|
||||||
|
|
||||||
|
return (int)time;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Does delay reductions based on dex/agi, sc data, item bonuses, ...
|
* Does delay reductions based on dex/agi, sc data, item bonuses, ...
|
||||||
*------------------------------------------*/
|
*------------------------------------------*/
|
||||||
|
@ -297,7 +297,10 @@ int skill_clear_group(struct block_list *bl, int flag);
|
|||||||
int skill_unit_ondamaged(struct skill_unit *src,struct block_list *bl,int damage,unsigned int tick);
|
int skill_unit_ondamaged(struct skill_unit *src,struct block_list *bl,int damage,unsigned int tick);
|
||||||
|
|
||||||
int skill_castfix( struct block_list *bl, int skill_id, int skill_lv);
|
int skill_castfix( struct block_list *bl, int skill_id, int skill_lv);
|
||||||
int skill_castfix_sc( struct block_list *bl, int time, int skill_id, int skill_lv);
|
int skill_castfix_sc( struct block_list *bl, int time);
|
||||||
|
#ifdef RENEWAL_CAST
|
||||||
|
int skill_vfcastfix( struct block_list *bl, double time, int skill_id, int skill_lv);
|
||||||
|
#endif
|
||||||
int skill_delayfix( struct block_list *bl, int skill_id, int skill_lv);
|
int skill_delayfix( struct block_list *bl, int skill_id, int skill_lv);
|
||||||
|
|
||||||
// Skill conditions check and remove [Inkfish]
|
// Skill conditions check and remove [Inkfish]
|
||||||
|
@ -2315,8 +2315,6 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
|
|||||||
sd->critical_rate = sd->hit_rate = sd->flee_rate = sd->flee2_rate = 100;
|
sd->critical_rate = sd->hit_rate = sd->flee_rate = sd->flee2_rate = 100;
|
||||||
sd->def_rate = sd->def2_rate = sd->mdef_rate = sd->mdef2_rate = 100;
|
sd->def_rate = sd->def2_rate = sd->mdef_rate = sd->mdef2_rate = 100;
|
||||||
sd->regen.state.block = 0;
|
sd->regen.state.block = 0;
|
||||||
sd->fixcastrate=100;
|
|
||||||
sd->varcastrate=100;
|
|
||||||
|
|
||||||
// zeroed arrays, order follows the order in pc.h.
|
// zeroed arrays, order follows the order in pc.h.
|
||||||
// add new arrays to the end of zeroed area in pc.h (see comments) and size here. [zzo]
|
// add new arrays to the end of zeroed area in pc.h (see comments) and size here. [zzo]
|
||||||
@ -2836,7 +2834,9 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
|
|||||||
if((skill=pc_checkskill(sd,BS_WEAPONRESEARCH))>0)
|
if((skill=pc_checkskill(sd,BS_WEAPONRESEARCH))>0)
|
||||||
status->hit += skill*2;
|
status->hit += skill*2;
|
||||||
if((skill=pc_checkskill(sd,AC_VULTURE))>0){
|
if((skill=pc_checkskill(sd,AC_VULTURE))>0){
|
||||||
|
#ifndef RENEWAL
|
||||||
status->hit += skill;
|
status->hit += skill;
|
||||||
|
#endif
|
||||||
if(sd->status.weapon == W_BOW)
|
if(sd->status.weapon == W_BOW)
|
||||||
status->rhw.range += skill;
|
status->rhw.range += skill;
|
||||||
}
|
}
|
||||||
@ -2978,10 +2978,6 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
|
|||||||
sd->hprecov_rate = 0;
|
sd->hprecov_rate = 0;
|
||||||
if(sd->sprecov_rate < 0)
|
if(sd->sprecov_rate < 0)
|
||||||
sd->sprecov_rate = 0;
|
sd->sprecov_rate = 0;
|
||||||
if(sd->fixcastrate < 0)
|
|
||||||
sd->fixcastrate = 0;
|
|
||||||
if(sd->varcastrate < 0)
|
|
||||||
sd->varcastrate = 0;
|
|
||||||
|
|
||||||
// Anti-element and anti-race
|
// Anti-element and anti-race
|
||||||
if((skill=pc_checkskill(sd,CR_TRUST))>0)
|
if((skill=pc_checkskill(sd,CR_TRUST))>0)
|
||||||
@ -7853,7 +7849,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
|
|||||||
case SC_PYREXIA:
|
case SC_PYREXIA:
|
||||||
status_change_start(bl,SC_BLIND,10000,val1,0,0,0,30000,11); // Blind status that last for 30 seconds
|
status_change_start(bl,SC_BLIND,10000,val1,0,0,0,30000,11); // Blind status that last for 30 seconds
|
||||||
val4 = tick / 3000;
|
val4 = tick / 3000;
|
||||||
tick_time = 4000; // [GodLesZ] tick time
|
tick_time = 3000; // [GodLesZ] tick time
|
||||||
break;
|
break;
|
||||||
case SC_LEECHESEND:
|
case SC_LEECHESEND:
|
||||||
val4 = tick / 1000;
|
val4 = tick / 1000;
|
||||||
@ -10488,13 +10484,10 @@ int status_change_spread( struct block_list *src, struct block_list *bl ) {
|
|||||||
switch( i ) {
|
switch( i ) {
|
||||||
//Debuffs that can be spreaded.
|
//Debuffs that can be spreaded.
|
||||||
// NOTE: We'll add/delte SCs when we are able to confirm it.
|
// NOTE: We'll add/delte SCs when we are able to confirm it.
|
||||||
case SC_POISON:
|
|
||||||
case SC_CURSE:
|
case SC_CURSE:
|
||||||
case SC_SILENCE:
|
case SC_SILENCE:
|
||||||
case SC_CONFUSION:
|
case SC_CONFUSION:
|
||||||
case SC_BLIND:
|
case SC_BLIND:
|
||||||
case SC_BLEEDING:
|
|
||||||
case SC_DPOISON:
|
|
||||||
case SC_NOCHAT:
|
case SC_NOCHAT:
|
||||||
case SC_HALLUCINATION:
|
case SC_HALLUCINATION:
|
||||||
case SC_SIGNUMCRUCIS:
|
case SC_SIGNUMCRUCIS:
|
||||||
@ -10511,16 +10504,9 @@ int status_change_spread( struct block_list *src, struct block_list *bl ) {
|
|||||||
//case SC__STRIPACCESSORY:
|
//case SC__STRIPACCESSORY:
|
||||||
case SC_BITE:
|
case SC_BITE:
|
||||||
case SC_FREEZING:
|
case SC_FREEZING:
|
||||||
case SC_BURNING:
|
|
||||||
case SC_FEAR:
|
|
||||||
case SC_PYREXIA:
|
|
||||||
case SC_PARALYSE:
|
|
||||||
case SC_DEATHHURT:
|
|
||||||
case SC_MAGICMUSHROOM:
|
|
||||||
case SC_VENOMBLEED:
|
case SC_VENOMBLEED:
|
||||||
case SC_TOXIN:
|
case SC_DEATHHURT:
|
||||||
case SC_OBLIVIONCURSE:
|
case SC_PARALYSE:
|
||||||
case SC_LEECHESEND:
|
|
||||||
if( sc->data[i]->timer != INVALID_TIMER ) {
|
if( sc->data[i]->timer != INVALID_TIMER ) {
|
||||||
timer = get_timer(sc->data[i]->timer);
|
timer = get_timer(sc->data[i]->timer);
|
||||||
if (timer == NULL || timer->func != status_change_timer || DIFF_TICK(timer->tick,tick) < 0)
|
if (timer == NULL || timer->func != status_change_timer || DIFF_TICK(timer->tick,tick) < 0)
|
||||||
@ -10528,17 +10514,42 @@ int status_change_spread( struct block_list *src, struct block_list *bl ) {
|
|||||||
data.tick = DIFF_TICK(timer->tick,tick);
|
data.tick = DIFF_TICK(timer->tick,tick);
|
||||||
} else
|
} else
|
||||||
data.tick = INVALID_TIMER;
|
data.tick = INVALID_TIMER;
|
||||||
data.val1 = sc->data[i]->val1;
|
break;
|
||||||
data.val2 = sc->data[i]->val2;
|
// Special cases
|
||||||
data.val3 = sc->data[i]->val3;
|
case SC_POISON:
|
||||||
data.val4 = sc->data[i]->val4;
|
case SC_DPOISON:
|
||||||
status_change_start(bl,i,10000,data.val1,data.val2,data.val3,data.val4,data.tick,1|2|8);
|
data.tick = sc->data[i]->val3 * 1000;
|
||||||
flag = 1;
|
break;
|
||||||
|
case SC_FEAR:
|
||||||
|
case SC_LEECHESEND:
|
||||||
|
data.tick = sc->data[i]->val4 * 1000;
|
||||||
|
break;
|
||||||
|
case SC_BURNING:
|
||||||
|
data.tick = sc->data[i]->val4 * 2000;
|
||||||
|
break;
|
||||||
|
case SC_PYREXIA:
|
||||||
|
case SC_OBLIVIONCURSE:
|
||||||
|
data.tick = sc->data[i]->val4 * 3000;
|
||||||
|
break;
|
||||||
|
case SC_MAGICMUSHROOM:
|
||||||
|
data.tick = sc->data[i]->val4 * 4000;
|
||||||
|
break;
|
||||||
|
case SC_TOXIN:
|
||||||
|
case SC_BLEEDING:
|
||||||
|
data.tick = sc->data[i]->val4 * 10000;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
continue;
|
continue;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if( i ){
|
||||||
|
data.val1 = sc->data[i]->val1;
|
||||||
|
data.val2 = sc->data[i]->val2;
|
||||||
|
data.val3 = sc->data[i]->val3;
|
||||||
|
data.val4 = sc->data[i]->val4;
|
||||||
|
status_change_start(bl,(sc_type)i,10000,data.val1,data.val2,data.val3,data.val4,data.tick,1|2|8);
|
||||||
|
flag = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return flag;
|
return flag;
|
||||||
|
@ -1040,6 +1040,9 @@ int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, sh
|
|||||||
target_id = sc->data[SC_COMBO]->val2;
|
target_id = sc->data[SC_COMBO]->val2;
|
||||||
else
|
else
|
||||||
target_id = ud->target;
|
target_id = ud->target;
|
||||||
|
|
||||||
|
if( skill_get_inf(skill_num)&INF_SELF_SKILL && skill_get_nk(skill_num)&NK_NO_DAMAGE )// exploit fix
|
||||||
|
target_id = src->id;
|
||||||
temp = 1;
|
temp = 1;
|
||||||
} else
|
} else
|
||||||
if ( target_id == src->id &&
|
if ( target_id == src->id &&
|
||||||
@ -1250,8 +1253,13 @@ int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, sh
|
|||||||
}
|
}
|
||||||
|
|
||||||
// moved here to prevent Suffragium from ending if skill fails
|
// moved here to prevent Suffragium from ending if skill fails
|
||||||
|
#ifndef RENEWAL_CAST
|
||||||
if (!(skill_get_castnodex(skill_num, skill_lv)&2))
|
if (!(skill_get_castnodex(skill_num, skill_lv)&2))
|
||||||
casttime = skill_castfix_sc(src, casttime, skill_num, skill_lv);
|
casttime = skill_castfix_sc(src, casttime);
|
||||||
|
#else
|
||||||
|
casttime = skill_vfcastfix(src, casttime, skill_num, skill_lv);
|
||||||
|
#endif
|
||||||
|
|
||||||
// in official this is triggered even if no cast time.
|
// in official this is triggered even if no cast time.
|
||||||
clif_skillcasting(src, src->id, target_id, 0,0, skill_num, skill_get_ele(skill_num, skill_lv), casttime);
|
clif_skillcasting(src, src->id, target_id, 0,0, skill_num, skill_get_ele(skill_num, skill_lv), casttime);
|
||||||
if( casttime > 0 || temp )
|
if( casttime > 0 || temp )
|
||||||
@ -1408,8 +1416,13 @@ int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, sh
|
|||||||
unit_stop_attack(src);
|
unit_stop_attack(src);
|
||||||
|
|
||||||
// moved here to prevent Suffragium from ending if skill fails
|
// moved here to prevent Suffragium from ending if skill fails
|
||||||
|
#ifndef RENEWAL_CAST
|
||||||
if (!(skill_get_castnodex(skill_num, skill_lv)&2))
|
if (!(skill_get_castnodex(skill_num, skill_lv)&2))
|
||||||
casttime = skill_castfix_sc(src, casttime, skill_num, skill_lv);
|
casttime = skill_castfix_sc(src, casttime);
|
||||||
|
#else
|
||||||
|
casttime = skill_vfcastfix(src, casttime, skill_num, skill_lv );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
ud->state.skillcastcancel = castcancel&&casttime>0?1:0;
|
ud->state.skillcastcancel = castcancel&&casttime>0?1:0;
|
||||||
if( !sd || sd->skillitem != skill_num || skill_get_cast(skill_num,skill_lv) )
|
if( !sd || sd->skillitem != skill_num || skill_get_cast(skill_num,skill_lv) )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user