Compare commits
10 Commits
master
...
refactor/S
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4609695882 | ||
![]() |
30eca30350 | ||
![]() |
0c8a62abbd | ||
![]() |
a73da61129 | ||
![]() |
4dc7001d6a | ||
![]() |
8807632e4a | ||
![]() |
d4f21d9800 | ||
![]() |
16506fa61e | ||
![]() |
dc90bc159d | ||
![]() |
79a127e510 |
@ -172,6 +172,10 @@ min_npc_vendchat_distance: 3
|
|||||||
// Default is 25. 100 = 100% Increase.
|
// Default is 25. 100 = 100% Increase.
|
||||||
rental_mount_speed_boost: 25
|
rental_mount_speed_boost: 25
|
||||||
|
|
||||||
|
// Display all status changes in the status window? (Note 1)
|
||||||
|
// Default (official): no
|
||||||
|
show_status_sc: no
|
||||||
|
|
||||||
//===================================
|
//===================================
|
||||||
// VIP system
|
// VIP system
|
||||||
//===================================
|
//===================================
|
||||||
|
@ -1276,7 +1276,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Damage reductions
|
// Damage reductions
|
||||||
// Assumptio doubles the def & mdef on RE mode, otherwise gives a reduction on the final damage. [Igniz]
|
// Assumptio gives a reduction on the final damage in pre-re. [Igniz]
|
||||||
#ifndef RENEWAL
|
#ifndef RENEWAL
|
||||||
if( sc->data[SC_ASSUMPTIO] ) {
|
if( sc->data[SC_ASSUMPTIO] ) {
|
||||||
if( map_flag_vs(bl->m) )
|
if( map_flag_vs(bl->m) )
|
||||||
@ -4594,15 +4594,15 @@ struct Damage battle_attack_sc_bonus(struct Damage wd, struct block_list *src, s
|
|||||||
return wd;
|
return wd;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*====================================
|
/**
|
||||||
* Calc defense damage reduction
|
* Calculates defense based on src and target
|
||||||
*------------------------------------
|
* @param src: Source object
|
||||||
* Credits:
|
* @param target: Target object
|
||||||
* Original coder Skotlex
|
* @param skill_id: Skill used
|
||||||
* Initial refactoring by Baalberith
|
* @param flag: 0 - Return armor defense, 1 - Return status defense
|
||||||
* Refined and optimized by helvetica
|
* @return defense
|
||||||
*/
|
*/
|
||||||
struct Damage battle_calc_defense_reduction(struct Damage wd, struct block_list *src,struct block_list *target, uint16 skill_id, uint16 skill_lv)
|
static short battle_get_defense(struct block_list *src, struct block_list *target, uint16 skill_id, uint8 flag)
|
||||||
{
|
{
|
||||||
struct map_session_data *sd = BL_CAST(BL_PC, src);
|
struct map_session_data *sd = BL_CAST(BL_PC, src);
|
||||||
struct map_session_data *tsd = BL_CAST(BL_PC, target);
|
struct map_session_data *tsd = BL_CAST(BL_PC, target);
|
||||||
@ -4611,29 +4611,27 @@ struct Damage battle_calc_defense_reduction(struct Damage wd, struct block_list
|
|||||||
struct status_data *sstatus = status_get_status_data(src);
|
struct status_data *sstatus = status_get_status_data(src);
|
||||||
struct status_data *tstatus = status_get_status_data(target);
|
struct status_data *tstatus = status_get_status_data(target);
|
||||||
|
|
||||||
//Defense reduction
|
// Don't use tstatus->def1 due to skill timer reductions.
|
||||||
short vit_def;
|
defType def1 = status_get_def(target); // eDEF
|
||||||
defType def1 = status_get_def(target); //Don't use tstatus->def1 due to skill timer reductions.
|
short def2 = tstatus->def2, vit_def; // sDEF
|
||||||
short def2 = tstatus->def2;
|
|
||||||
|
|
||||||
#ifdef RENEWAL
|
|
||||||
if( tsc && tsc->data[SC_ASSUMPTIO] )
|
|
||||||
def1 <<= 1; // only eDEF is doubled
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (sd) {
|
if (sd) {
|
||||||
int i = sd->ignore_def_by_race[tstatus->race] + sd->ignore_def_by_race[RC_ALL];
|
int i = sd->ignore_def_by_race[tstatus->race] + sd->ignore_def_by_race[RC_ALL];
|
||||||
i += sd->ignore_def_by_class[tstatus->class_] + sd->ignore_def_by_class[CLASS_ALL];
|
|
||||||
if (i) {
|
|
||||||
i = min(i,100); //cap it to 100 for 0 def min
|
|
||||||
def1 -= def1 * i / 100;
|
|
||||||
def2 -= def2 * i / 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Kagerou/Oboro Earth Charm effect +10% eDEF
|
//Kagerou/Oboro Earth Charm effect +10% eDEF
|
||||||
if(sd->spiritcharm_type == CHARM_TYPE_LAND && sd->spiritcharm > 0) {
|
if(sd->spiritcharm_type == CHARM_TYPE_LAND && sd->spiritcharm > 0) {
|
||||||
short si = 10 * sd->spiritcharm;
|
short si = 10 * sd->spiritcharm;
|
||||||
def1 = (def1 * (100 + si)) / 100;
|
|
||||||
|
def1 = def1 * (100 + si) / 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
i += sd->ignore_def_by_class[tstatus->class_] + sd->ignore_def_by_class[CLASS_ALL];
|
||||||
|
if (i) {
|
||||||
|
i = min(i, 100); //cap it to 100 for 0 def min
|
||||||
|
def1 -= def1 * i / 100;
|
||||||
|
#ifndef RENEWAL
|
||||||
|
def2 -= def2 * i / 100;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4642,29 +4640,9 @@ struct Damage battle_calc_defense_reduction(struct Damage wd, struct block_list
|
|||||||
|
|
||||||
i = min(i,100); //cap it to 100 for 0 def min
|
i = min(i,100); //cap it to 100 for 0 def min
|
||||||
def1 = (def1*(100-i))/100;
|
def1 = (def1*(100-i))/100;
|
||||||
|
#ifndef RENEWAL
|
||||||
def2 = (def2*(100-i))/100;
|
def2 = (def2*(100-i))/100;
|
||||||
}
|
#endif
|
||||||
|
|
||||||
if (tsc) {
|
|
||||||
if (tsc->data[SC_FORCEOFVANGUARD]) {
|
|
||||||
short i = 2 * tsc->data[SC_FORCEOFVANGUARD]->val1;
|
|
||||||
|
|
||||||
def1 = (def1 * (100 + i)) / 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( tsc->data[SC_CAMOUFLAGE] ){
|
|
||||||
short i = 5 * tsc->data[SC_CAMOUFLAGE]->val3; //5% per second
|
|
||||||
|
|
||||||
i = min(i,100); //cap it to 100 for 0 def min
|
|
||||||
def1 = (def1*(100-i))/100;
|
|
||||||
def2 = (def2*(100-i))/100;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tsc->data[SC_GT_REVITALIZE])
|
|
||||||
def2 += tsc->data[SC_GT_REVITALIZE]->val4;
|
|
||||||
|
|
||||||
if (tsc->data[SC_OVERED_BOOST] && target->type == BL_PC)
|
|
||||||
def1 = (def1 * tsc->data[SC_OVERED_BOOST]->val4) / 100;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( battle_config.vit_penalty_type && battle_config.vit_penalty_target&target->type ) {
|
if( battle_config.vit_penalty_type && battle_config.vit_penalty_target&target->type ) {
|
||||||
@ -4683,10 +4661,11 @@ struct Damage battle_calc_defense_reduction(struct Damage wd, struct block_list
|
|||||||
def2 -= (target_count - (battle_config.vit_penalty_count - 1))*battle_config.vit_penalty_num;
|
def2 -= (target_count - (battle_config.vit_penalty_count - 1))*battle_config.vit_penalty_num;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (skill_id == AM_ACIDTERROR)
|
|
||||||
#ifdef RENEWAL
|
#ifdef RENEWAL
|
||||||
|
if (skill_id == AM_ACIDTERROR)
|
||||||
def2 = 0; //Ignore only status defense. [FatalEror]
|
def2 = 0; //Ignore only status defense. [FatalEror]
|
||||||
#else
|
#else
|
||||||
|
if (skill_id == AM_ACIDTERROR)
|
||||||
def1 = 0; //Ignores only armor defense. [Skotlex]
|
def1 = 0; //Ignores only armor defense. [Skotlex]
|
||||||
#endif
|
#endif
|
||||||
if(def2 < 1)
|
if(def2 < 1)
|
||||||
@ -4730,6 +4709,30 @@ struct Damage battle_calc_defense_reduction(struct Damage wd, struct block_list
|
|||||||
def1 = 0;
|
def1 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!flag)
|
||||||
|
return (short)def1;
|
||||||
|
else
|
||||||
|
return vit_def;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculate defense damage reduction
|
||||||
|
* @param wd: Weapon data
|
||||||
|
* @param src: Source object
|
||||||
|
* @param target: Target object
|
||||||
|
* @param skill_id: Skill used
|
||||||
|
* @param skill_lv: Skill level used
|
||||||
|
* @return weapon data
|
||||||
|
* Credits:
|
||||||
|
* Original coder Skotlex
|
||||||
|
* Initial refactoring by Baalberith
|
||||||
|
* Refined and optimized by helvetica
|
||||||
|
*/
|
||||||
|
struct Damage battle_calc_defense_reduction(struct Damage wd, struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv)
|
||||||
|
{
|
||||||
|
short def1 = battle_get_defense(src, target, skill_id, 0);
|
||||||
|
short vit_def = battle_get_defense(src, target, skill_id, 1);
|
||||||
|
|
||||||
#ifdef RENEWAL
|
#ifdef RENEWAL
|
||||||
/**
|
/**
|
||||||
* RE DEF Reduction
|
* RE DEF Reduction
|
||||||
@ -6214,12 +6217,9 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
|
|||||||
ad.damage -= (int64)ad.damage*i/100;
|
ad.damage -= (int64)ad.damage*i/100;
|
||||||
|
|
||||||
if(!flag.imdef){
|
if(!flag.imdef){
|
||||||
defType mdef = tstatus->mdef;
|
defType mdef = tstatus->mdef; // eMDEF
|
||||||
int mdef2= tstatus->mdef2;
|
short mdef2 = tstatus->mdef2; // sMDEF
|
||||||
#ifdef RENEWAL
|
|
||||||
if(tsc && tsc->data[SC_ASSUMPTIO])
|
|
||||||
mdef <<= 1; // only eMDEF is doubled
|
|
||||||
#endif
|
|
||||||
if(sd) {
|
if(sd) {
|
||||||
i = sd->ignore_mdef_by_race[tstatus->race] + sd->ignore_mdef_by_race[RC_ALL];
|
i = sd->ignore_mdef_by_race[tstatus->race] + sd->ignore_mdef_by_race[RC_ALL];
|
||||||
i += sd->ignore_mdef_by_class[tstatus->class_] + sd->ignore_mdef_by_class[CLASS_ALL];
|
i += sd->ignore_mdef_by_class[tstatus->class_] + sd->ignore_mdef_by_class[CLASS_ALL];
|
||||||
@ -6228,7 +6228,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
|
|||||||
{
|
{
|
||||||
if (i > 100) i = 100;
|
if (i > 100) i = 100;
|
||||||
mdef -= mdef * i/100;
|
mdef -= mdef * i/100;
|
||||||
//mdef2-= mdef2* i/100;
|
mdef2-= mdef2* i/100;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef RENEWAL
|
#ifdef RENEWAL
|
||||||
@ -8424,6 +8424,7 @@ static const struct _battle_data {
|
|||||||
{ "exp_cost_inspiration", &battle_config.exp_cost_inspiration, 1, 0, 100, },
|
{ "exp_cost_inspiration", &battle_config.exp_cost_inspiration, 1, 0, 100, },
|
||||||
{ "mvp_exp_reward_message", &battle_config.mvp_exp_reward_message, 0, 0, 1, },
|
{ "mvp_exp_reward_message", &battle_config.mvp_exp_reward_message, 0, 0, 1, },
|
||||||
{ "can_damage_skill", &battle_config.can_damage_skill, 1, 0, BL_ALL, },
|
{ "can_damage_skill", &battle_config.can_damage_skill, 1, 0, BL_ALL, },
|
||||||
|
{ "show_status_sc", &battle_config.show_status_sc, 0, 0, 1, },
|
||||||
{ "atcommand_levelup_events", &battle_config.atcommand_levelup_events, 0, 0, 1, },
|
{ "atcommand_levelup_events", &battle_config.atcommand_levelup_events, 0, 0, 1, },
|
||||||
{ "block_account_in_same_party", &battle_config.block_account_in_same_party, 1, 0, 1, },
|
{ "block_account_in_same_party", &battle_config.block_account_in_same_party, 1, 0, 1, },
|
||||||
{ "tarotcard_equal_chance", &battle_config.tarotcard_equal_chance, 0, 0, 1, },
|
{ "tarotcard_equal_chance", &battle_config.tarotcard_equal_chance, 0, 0, 1, },
|
||||||
|
@ -617,6 +617,7 @@ struct Battle_Config
|
|||||||
int exp_cost_inspiration;
|
int exp_cost_inspiration;
|
||||||
int mvp_exp_reward_message;
|
int mvp_exp_reward_message;
|
||||||
int can_damage_skill; //Which BL types can damage traps
|
int can_damage_skill; //Which BL types can damage traps
|
||||||
|
int show_status_sc;
|
||||||
int atcommand_levelup_events;
|
int atcommand_levelup_events;
|
||||||
int block_account_in_same_party;
|
int block_account_in_same_party;
|
||||||
int tarotcard_equal_chance; //Official or equal chance for each card
|
int tarotcard_equal_chance; //Official or equal chance for each card
|
||||||
|
@ -3192,13 +3192,13 @@ void clif_updatestatus(struct map_session_data *sd,int type)
|
|||||||
WFIFOL(fd,4)=sd->status.skill_point;
|
WFIFOL(fd,4)=sd->status.skill_point;
|
||||||
break;
|
break;
|
||||||
case SP_HIT:
|
case SP_HIT:
|
||||||
WFIFOL(fd,4)=sd->battle_status.hit;
|
WFIFOL(fd,4)=sd->display_status.hit;
|
||||||
break;
|
break;
|
||||||
case SP_FLEE1:
|
case SP_FLEE1:
|
||||||
WFIFOL(fd,4)=sd->battle_status.flee;
|
WFIFOL(fd,4)=sd->display_status.flee;
|
||||||
break;
|
break;
|
||||||
case SP_FLEE2:
|
case SP_FLEE2:
|
||||||
WFIFOL(fd,4)=sd->battle_status.flee2/10;
|
WFIFOL(fd,4)=sd->display_status.flee2/10;
|
||||||
break;
|
break;
|
||||||
case SP_MAXHP:
|
case SP_MAXHP:
|
||||||
WFIFOL(fd,4)=sd->battle_status.max_hp;
|
WFIFOL(fd,4)=sd->battle_status.max_hp;
|
||||||
@ -3245,7 +3245,7 @@ void clif_updatestatus(struct map_session_data *sd,int type)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SP_CRITICAL:
|
case SP_CRITICAL:
|
||||||
WFIFOL(fd,4)=sd->battle_status.cri/10;
|
WFIFOL(fd,4)=sd->display_status.cri/10;
|
||||||
break;
|
break;
|
||||||
case SP_MATK1:
|
case SP_MATK1:
|
||||||
WFIFOL(fd,4)=pc_rightside_matk(sd);
|
WFIFOL(fd,4)=pc_rightside_matk(sd);
|
||||||
|
@ -202,7 +202,7 @@ struct map_session_data {
|
|||||||
struct block_list bl;
|
struct block_list bl;
|
||||||
struct unit_data ud;
|
struct unit_data ud;
|
||||||
struct view_data vd;
|
struct view_data vd;
|
||||||
struct status_data base_status, battle_status;
|
struct status_data base_status, battle_status, display_status;
|
||||||
struct status_change sc;
|
struct status_change sc;
|
||||||
struct regen_data regen;
|
struct regen_data regen;
|
||||||
struct regen_data_sub sregen, ssregen;
|
struct regen_data_sub sregen, ssregen;
|
||||||
@ -951,35 +951,25 @@ short pc_maxaspd(struct map_session_data *sd);
|
|||||||
)
|
)
|
||||||
#define pcdb_checkid(class_) pcdb_checkid_sub((unsigned int)class_)
|
#define pcdb_checkid(class_) pcdb_checkid_sub((unsigned int)class_)
|
||||||
|
|
||||||
// clientside display macros (values to the left/right of the "+")
|
// clientside DISPLAY(!) macros (values to the left/right of the "+")
|
||||||
#ifdef RENEWAL
|
#ifdef RENEWAL
|
||||||
#define pc_leftside_atk(sd) ((sd)->battle_status.batk)
|
#define pc_leftside_atk(sd) ((sd)->display_status.batk)
|
||||||
#define pc_rightside_atk(sd) ((sd)->battle_status.watk + (sd)->battle_status.watk2 + (sd)->battle_status.eatk)
|
#define pc_rightside_atk(sd) ((sd)->display_status.watk + (sd)->display_status.watk2 + (sd)->battle_status.eatk)
|
||||||
#define pc_leftside_def(sd) ((sd)->battle_status.def2)
|
#define pc_leftside_def(sd) ((sd)->display_status.def2)
|
||||||
#define pc_rightside_def(sd) ((sd)->battle_status.def)
|
#define pc_rightside_def(sd) ((sd)->display_status.def)
|
||||||
#define pc_leftside_mdef(sd) ((sd)->battle_status.mdef2)
|
#define pc_leftside_mdef(sd) ((sd)->display_status.mdef2)
|
||||||
#define pc_rightside_mdef(sd) ((sd)->battle_status.mdef)
|
#define pc_rightside_mdef(sd) ((sd)->display_status.mdef)
|
||||||
#define pc_leftside_matk(sd) (status_base_matk(&(sd)->bl, status_get_status_data(&(sd)->bl), (sd)->status.base_level))
|
#define pc_leftside_matk(sd) (status_base_matk(&(sd)->bl, status_get_status_data(&(sd)->bl), (sd)->status.base_level))
|
||||||
#define pc_rightside_matk(sd) ((sd)->battle_status.rhw.matk+(sd)->battle_status.lhw.matk+(sd)->bonus.ematk)
|
#define pc_rightside_matk(sd) ((sd)->display_status.rhw.matk+(sd)->display_status.lhw.matk+(sd)->bonus.ematk)
|
||||||
#else
|
#else
|
||||||
#define pc_leftside_atk(sd) ((sd)->battle_status.batk + (sd)->battle_status.rhw.atk + (sd)->battle_status.lhw.atk)
|
#define pc_leftside_atk(sd) ((sd)->display_status.batk + (sd)->display_status.rhw.atk + (sd)->display_status.lhw.atk)
|
||||||
#define pc_rightside_atk(sd) ((sd)->battle_status.rhw.atk2 + (sd)->battle_status.lhw.atk2)
|
#define pc_rightside_atk(sd) ((sd)->display_status.rhw.atk2 + (sd)->display_status.lhw.atk2)
|
||||||
#define pc_leftside_def(sd) ((sd)->battle_status.def)
|
#define pc_leftside_def(sd) ((sd)->display_status.def)
|
||||||
#define pc_rightside_def(sd) ((sd)->battle_status.def2)
|
#define pc_rightside_def(sd) ((sd)->display_status.def2)
|
||||||
#define pc_leftside_mdef(sd) ((sd)->battle_status.mdef)
|
#define pc_leftside_mdef(sd) ((sd)->display_status.mdef)
|
||||||
#define pc_rightside_mdef(sd) ( (sd)->battle_status.mdef2 - ((sd)->battle_status.vit>>1) )
|
#define pc_rightside_mdef(sd) ( (sd)->display_status.mdef2 - ((sd)->battle_status.vit>>1) )
|
||||||
#define pc_leftside_matk(sd) \
|
#define pc_leftside_matk(sd) ((sd)->display_status.matk_min)
|
||||||
(\
|
#define pc_rightside_matk(sd) ((sd)->display_status.matk_max)
|
||||||
((sd)->sc.data[SC_MAGICPOWER] && (sd)->sc.data[SC_MAGICPOWER]->val4) \
|
|
||||||
?((sd)->battle_status.matk_min * 100 + 50) / ((sd)->sc.data[SC_MAGICPOWER]->val3+100) \
|
|
||||||
:(sd)->battle_status.matk_min \
|
|
||||||
)
|
|
||||||
#define pc_rightside_matk(sd) \
|
|
||||||
(\
|
|
||||||
((sd)->sc.data[SC_MAGICPOWER] && (sd)->sc.data[SC_MAGICPOWER]->val4) \
|
|
||||||
?((sd)->battle_status.matk_max * 100 + 50) / ((sd)->sc.data[SC_MAGICPOWER]->val3+100) \
|
|
||||||
:(sd)->battle_status.matk_max \
|
|
||||||
)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void pc_set_reg_load(bool val);
|
void pc_set_reg_load(bool val);
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user