Fixed left-hand issue, gives damage to emperium (if emperium mode is MD_PLANT) although guild castle >= 'guild_max_castles' (bugreport:8125)
This commit is contained in:
parent
b85f469bd5
commit
221553a893
@ -1297,30 +1297,38 @@ int64 battle_calc_bg_damage(struct block_list *src, struct block_list *bl, int64
|
|||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool battle_can_hit_gvg_target(struct block_list *src,struct block_list *bl,uint16 skill_id,int flag)
|
||||||
|
{
|
||||||
|
struct mob_data* md = BL_CAST(BL_MOB, bl);
|
||||||
|
int class_ = status_get_class(bl);
|
||||||
|
|
||||||
|
if(md && md->guardian_data) {
|
||||||
|
if(class_ == MOBID_EMPERIUM && flag&BF_SKILL && !(skill_get_inf3(skill_id)&INF3_HIT_EMP)) //Skill immunity.
|
||||||
|
return false;
|
||||||
|
if(src->type != BL_MOB) {
|
||||||
|
struct guild *g = src->type == BL_PC ? ((TBL_PC *)src)->guild : guild_search(status_get_guild_id(src));
|
||||||
|
|
||||||
|
if (class_ == MOBID_EMPERIUM && (!g || guild_checkskill(g,GD_APPROVAL) <= 0 ))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (g && battle_config.guild_max_castles && guild_checkcastles(g)>=battle_config.guild_max_castles)
|
||||||
|
return false; // [MouseJstr]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Calculates GVG related damage adjustments.
|
* Calculates GVG related damage adjustments.
|
||||||
*------------------------------------------*/
|
*------------------------------------------*/
|
||||||
int64 battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int64 damage,int div_,uint16 skill_id,uint16 skill_lv,int flag)
|
int64 battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int64 damage,int div_,uint16 skill_id,uint16 skill_lv,int flag)
|
||||||
{
|
{
|
||||||
struct mob_data* md = BL_CAST(BL_MOB, bl);
|
|
||||||
int class_ = status_get_class(bl);
|
|
||||||
|
|
||||||
if (!damage) //No reductions to make.
|
if (!damage) //No reductions to make.
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if(md && md->guardian_data) {
|
if (!battle_can_hit_gvg_target(src,bl,skill_id,flag))
|
||||||
if(class_ == MOBID_EMPERIUM && flag&BF_SKILL && !(skill_get_inf3(skill_id)&INF3_HIT_EMP)) //Skill immunity.
|
|
||||||
return 0;
|
|
||||||
if(src->type != BL_MOB) {
|
|
||||||
struct guild *g = src->type == BL_PC ? ((TBL_PC *)src)->guild : guild_search(status_get_guild_id(src));
|
|
||||||
|
|
||||||
if (class_ == MOBID_EMPERIUM && (!g || guild_checkskill(g,GD_APPROVAL) <= 0 ))
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (g && battle_config.guild_max_castles && guild_checkcastles(g)>=battle_config.guild_max_castles)
|
|
||||||
return 0; // [MouseJstr]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (skill_get_inf2(skill_id)&INF2_NO_GVG_DMG) //Skills with no gvg damage reduction.
|
if (skill_get_inf2(skill_id)&INF2_NO_GVG_DMG) //Skills with no gvg damage reduction.
|
||||||
return damage;
|
return damage;
|
||||||
/* Uncomment if you want god-mode Emperiums at 100 defense. [Kisuka]
|
/* Uncomment if you want god-mode Emperiums at 100 defense. [Kisuka]
|
||||||
@ -4029,7 +4037,12 @@ struct Damage battle_calc_attack_plant(struct Damage wd, struct block_list *src,
|
|||||||
wd.damage2 = wd.div_;
|
wd.damage2 = wd.div_;
|
||||||
if (is_attack_right_handed(src, skill_id) && is_attack_left_handed(src, skill_id)) // force left hand to 1 damage while dual wielding [helvetica]
|
if (is_attack_right_handed(src, skill_id) && is_attack_left_handed(src, skill_id)) // force left hand to 1 damage while dual wielding [helvetica]
|
||||||
wd.damage2 = 1;
|
wd.damage2 = 1;
|
||||||
|
|
||||||
if( attack_hits && class_ == MOBID_EMPERIUM ) {
|
if( attack_hits && class_ == MOBID_EMPERIUM ) {
|
||||||
|
if(target && map_flag_gvg2(target->m) && !battle_can_hit_gvg_target(src,target,skill_id,(skill_id)?BF_SKILL:0)) {
|
||||||
|
wd.damage = wd.damage2 = 0;
|
||||||
|
return wd;
|
||||||
|
}
|
||||||
if( wd.damage2 > 0 ) {
|
if( wd.damage2 > 0 ) {
|
||||||
wd.damage2 = battle_attr_fix(src, target, wd.damage2, left_element, tstatus->def_ele, tstatus->ele_lv);
|
wd.damage2 = battle_attr_fix(src, target, wd.damage2, left_element, tstatus->def_ele, tstatus->ele_lv);
|
||||||
wd.damage2 = battle_calc_gvg_damage(src, target, wd.damage2, wd.div_, skill_id, skill_lv, wd.flag);
|
wd.damage2 = battle_calc_gvg_damage(src, target, wd.damage2, wd.div_, skill_id, skill_lv, wd.flag);
|
||||||
@ -5698,6 +5711,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
|
|||||||
struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct block_list *target,uint16 skill_id,uint16 skill_lv,int count)
|
struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct block_list *target,uint16 skill_id,uint16 skill_lv,int count)
|
||||||
{
|
{
|
||||||
struct Damage d;
|
struct Damage d;
|
||||||
|
|
||||||
switch(attack_type) {
|
switch(attack_type) {
|
||||||
case BF_WEAPON: d = battle_calc_weapon_attack(bl,target,skill_id,skill_lv,count); break;
|
case BF_WEAPON: d = battle_calc_weapon_attack(bl,target,skill_id,skill_lv,count); break;
|
||||||
case BF_MAGIC: d = battle_calc_magic_attack(bl,target,skill_id,skill_lv,count); break;
|
case BF_MAGIC: d = battle_calc_magic_attack(bl,target,skill_id,skill_lv,count); break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user