Skip to content

Commit

Permalink
Bug Fixes
Browse files Browse the repository at this point in the history
* Fixed #167 - Dragon Breath burning chance is now 15% for all levels. Also corrected damage calculation. Thanks to @exneval.
* Fixed #270 - Cleaned up Reverberation and how it's triggered.
* Fixed #321 - Follow up to 1b6be4e. Fixed MATK calculation for for all player, monster, homunculus, mercenary, etc.
* Fixed #332 - Camouflage now hides player from targeting skills. Added missing DEF/DEF2 bonus.
* Fixed #335 - Check to make sure script has data before trying to free null values.
* Fixed Full Throttle SP drain amount and movement speed increase value. Updated cooldown value to 30 minutes.
* Fixed Bloody Lust skill type from magic to none.
* Fixed Mix Cooking, Make Bomb, Special Pharmacy, Change Material, and Rune Mastery success and fail animations.
* Cleaned up some more compile warnings.
  • Loading branch information
aleos89 committed Mar 13, 2015
1 parent d34a12e commit 9f6f55c
Show file tree
Hide file tree
Showing 11 changed files with 171 additions and 136 deletions.
2 changes: 1 addition & 1 deletion db/pre-re/skill_cast_db.txt
Expand Up @@ -1760,7 +1760,7 @@
//==========================================

//-- ALL_FULL_THROTTLE
5014,0,0,0,10000:15000:20000:25000:30000,10000,1800000
5014,0,0,0,10000:15000:20000:25000:30000,10000,3000000

//===== Homunculus Skills ==================
//-- HLIF_HEAL
Expand Down
2 changes: 1 addition & 1 deletion db/pre-re/skill_db.txt
Expand Up @@ -1067,7 +1067,7 @@
2300,7,6,2,0,0x1,0,3,1,yes,0,0,1,magic,0,0x0, SC_DIMENSIONDOOR,Dimension Door
2301,7,6,2,0,0x1,0,3,1,yes,0,0x20000,0,magic,0,0x0, SC_CHAOSPANIC,Chaos Panic
2302,7,6,2,0,0x1,0,3,1,yes,0,0x20000,1,magic,0,0x0, SC_MAELSTROM,Maelstrom
2303,7,6,2,0,0x1,0,3,1,yes,0,0,0,magic,0,0x0, SC_BLOODYLUST,Bloody Lust
2303,7,6,2,0,0x1,0,3,1,yes,0,0,0,none,0,0x0, SC_BLOODYLUST,Bloody Lust
2304,0,6,4,-1,0,0,3,1,no,0,0,0,weapon,0,0x0, SC_FEINTBOMB,Feint Bomb

//****
Expand Down
2 changes: 1 addition & 1 deletion db/pre-re/skill_unit_db.txt
Expand Up @@ -134,7 +134,7 @@

2319,0xec, , 0, 3,5000,all, 0x000 //LG_BANDING

2414,0xda, , 0, 0,1000,enemy, 0x1008 //WM_REVERBERATION
2414,0xda, , 0, 0, -1,enemy, 0x1000 //WM_REVERBERATION
2418,0xdb, , 0, 5, 300,enemy, 0x800 //WM_SEVERE_RAINSTORM
2419,0xde, , 0, 1,1000,enemy, 0x1014 //WM_POEMOFNETHERWORLD

Expand Down
2 changes: 1 addition & 1 deletion db/re/skill_cast_db.txt
Expand Up @@ -1754,7 +1754,7 @@
//==========================================

//-- ALL_FULL_THROTTLE
5014,0,0,0,10000:15000:20000:25000:30000,10000,1800000,-1
5014,0,0,0,10000:15000:20000:25000:30000,10000,3000000,-1

//===== Homunculus Skills ==================
//-- HLIF_HEAL
Expand Down
2 changes: 1 addition & 1 deletion db/re/skill_db.txt
Expand Up @@ -1067,7 +1067,7 @@
2300,7,6,2,0,0x1,0,3,1,yes,0,0,1,magic,0,0x0, SC_DIMENSIONDOOR,Dimension Door
2301,7,6,2,0,0x1,0,3,1,yes,0,0x20000,0,magic,0,0x0, SC_CHAOSPANIC,Chaos Panic
2302,7,6,2,0,0x1,0,3,1,yes,0,0x20000,1,magic,0,0x0, SC_MAELSTROM,Maelstrom
2303,7,6,2,0,0x1,0,3,1,yes,0,0,0,magic,0,0x0, SC_BLOODYLUST,Bloody Lust
2303,7,6,2,0,0x1,0,3,1,yes,0,0,0,none,0,0x0, SC_BLOODYLUST,Bloody Lust
2304,0,6,4,-1,0,0,3,1,no,0,0,0,weapon,0,0x0, SC_FEINTBOMB,Feint Bomb

//****
Expand Down
2 changes: 1 addition & 1 deletion db/re/skill_unit_db.txt
Expand Up @@ -136,7 +136,7 @@

2319,0xec, , 0, 3,5000,all, 0x000 //LG_BANDING

2414,0xda, , 0, 0,1000,enemy, 0x1008 //WM_REVERBERATION
2414,0xda, , 0, 0, -1,enemy, 0x1000 //WM_REVERBERATION
2418,0xdb, , 0, 5, 300,enemy, 0x800 //WM_SEVERE_RAINSTORM
2419,0xde, , 0, 1,1000,enemy, 0x1014 //WM_POEMOFNETHERWORLD

Expand Down
37 changes: 15 additions & 22 deletions src/map/battle.c
Expand Up @@ -2904,10 +2904,6 @@ struct Damage battle_calc_skill_base_damage(struct Damage wd, struct block_list
{
int damagevalue = 0;

wd.damage = wd.damage2 = 0;
#ifdef RENEWAL
wd.weaponAtk = wd.weaponAtk2 = 0;
#endif
damagevalue = ((sstatus->hp / 50) + (status_get_max_sp(src) / 4)) * skill_lv;
if(status_get_lv(src) > 100)
damagevalue = damagevalue * status_get_lv(src) / 150;
Expand All @@ -2923,10 +2919,6 @@ struct Damage battle_calc_skill_base_damage(struct Damage wd, struct block_list
case NC_SELFDESTRUCTION: {
int damagevalue = 0;

wd.damage = wd.damage2 = 0;
#ifdef RENEWAL
wd.weaponAtk = wd.weaponAtk2 = 0;
#endif
damagevalue = (skill_lv + 1) * ((sd ? pc_checkskill(sd,NC_MAINFRAME) : 0) + 8) * (status_get_sp(src) + sstatus->vit);
if(status_get_lv(src) > 100)
damagevalue = damagevalue * status_get_lv(src) / 100;
Expand All @@ -2940,10 +2932,6 @@ struct Damage battle_calc_skill_base_damage(struct Damage wd, struct block_list
case KO_HAPPOKUNAI: {
int damagevalue = 0;

wd.damage = wd.damage2 = 0;
#ifdef RENEWAL
wd.weaponAtk = wd.weaponAtk2 = 0;
#endif
if(sd) {
short index = sd->equip_index[EQI_AMMO];

Expand Down Expand Up @@ -5152,9 +5140,21 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src, struct bl
}
#ifndef RENEWAL
//Card Fix for attacker (sd), 2 is added to the "left" flag meaning "attacker cards only"
wd.damage += battle_calc_cardfix(BF_WEAPON, src, target, battle_skill_get_damage_properties(skill_id, wd.miscflag), right_element, left_element, wd.damage, 2, wd.flag);
if( is_attack_left_handed(src, skill_id ))
wd.damage2 += battle_calc_cardfix(BF_WEAPON, src, target, battle_skill_get_damage_properties(skill_id, wd.miscflag), right_element, left_element, wd.damage2, 3, wd.flag);
switch(skill_id) {
case RK_DRAGONBREATH:
case RK_DRAGONBREATH_WATER:
if(wd.flag&BF_LONG) { //Add check here, because we want to apply the same behavior in pre-renewal [exneval]
wd.damage = wd.damage * (100 + sd->bonus.long_attack_atk_rate) / 100;
if(is_attack_left_handed(src, skill_id))
wd.damage2 = wd.damage2 * (100 + sd->bonus.long_attack_atk_rate) / 100;
}
break;
default:
wd.damage += battle_calc_cardfix(BF_WEAPON, src, target, battle_skill_get_damage_properties(skill_id, wd.miscflag), right_element, left_element, wd.damage, 2, wd.flag);
if( is_attack_left_handed(src, skill_id ))
wd.damage2 += battle_calc_cardfix(BF_WEAPON, src, target, battle_skill_get_damage_properties(skill_id, wd.miscflag), right_element, left_element, wd.damage2, 3, wd.flag);
break;
}
#endif
}

Expand Down Expand Up @@ -6255,13 +6255,6 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
case NPC_EVILLAND:
md.damage = skill_calc_heal(src,target,skill_id,skill_lv,false);
break;
case RK_DRAGONBREATH_WATER:
case RK_DRAGONBREATH:
md.damage = ((status_get_hp(src) / 50) + (status_get_max_sp(src) / 4)) * skill_lv;
RE_LVL_MDMOD(150);
if (sd) md.damage = (int64)md.damage * (95 + 5 * pc_checkskill(sd,RK_DRAGONTRAINING)) / 100;
md.flag |= BF_LONG|BF_WEAPON;
break;
case RA_CLUSTERBOMB:
case RA_FIRINGTRAP:
case RA_ICEBOUNDTRAP:
Expand Down
2 changes: 1 addition & 1 deletion src/map/pc.c
Expand Up @@ -5521,7 +5521,7 @@ int pc_get_skillcooldown(struct map_session_data *sd, uint16 skill_id, uint16 sk
*------------------------------------------*/
uint8 pc_checkskill(struct map_session_data *sd, uint16 skill_id)
{
uint16 i = 0, idx = 0;
uint16 idx = 0;
if (sd == NULL)
return 0;
if ((idx = skill_get_index(skill_id)) == 0) {
Expand Down
2 changes: 2 additions & 0 deletions src/map/script.c
Expand Up @@ -3156,6 +3156,8 @@ void script_free_vars(struct DBMap* storage)

void script_free_code(struct script_code* code)
{
nullpo_retv(code);

script_free_vars( code->script_vars );
aFree( code->script_buf );
aFree( code );
Expand Down

7 comments on commit 9f6f55c

@RagnarokNova
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a ton Aleos! You're the best. :]

@aleos89
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem!

@reigneil
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is something wrong with the Skill Dragon Breath in Renewal mode... how can i damage monster if i cannot hit the target.

@julia40124009
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dragon Breath and Dragon Breath Water can't hit monster .

@reigneil
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i found what is the caused of this trouble... there is remaining attack type MISC in skill.c better to remove it and change MISC to WEAPON type attack.
if( sd && src != bl && damage > 0 && ( dmg.flag&BF_WEAPON ||
(dmg.flag&BF_MISC && (skill_id == RA_CLUSTERBOMB || skill_id == RA_FIRINGTRAP || skill_id == RA_ICEBOUNDTRAP || skill_id == RK_DRAGONBREATH || skill_id == RK_DRAGONBREATH_WATER)) ) )
{
if (battle_config.left_cardfix_to_right)
battle_drain(sd, bl, dmg.damage, dmg.damage, tstatus->race, tstatus->class_);
else
battle_drain(sd, bl, dmg.damage, dmg.damage2, tstatus->race, tstatus->class_);
}
and this...
case RK_DRAGONBREATH_WATER:
case RK_DRAGONBREATH: {
struct status_change *tsc2 = NULL;
if( (tsc2 = status_get_sc(bl)) && (tsc2->data[SC_HIDING] )) {
clif_skill_nodamage(src,src,skill_id,skill_lv,1);
} else
skill_attack(BF_MISC,src,src,bl,skill_id,skill_lv,tick,flag);
}
break;
to something like this...
if( sd && src != bl && damage > 0 && ( dmg.flag&BF_WEAPON ||
(dmg.flag&BF_MISC && (skill_id == RA_CLUSTERBOMB || skill_id == RA_FIRINGTRAP || skill_id == RA_ICEBOUNDTRAP)) ) )
{
if (battle_config.left_cardfix_to_right)
battle_drain(sd, bl, dmg.damage, dmg.damage, tstatus->race, tstatus->class_);
else
battle_drain(sd, bl, dmg.damage, dmg.damage2, tstatus->race, tstatus->class_);
}
and...
case RK_DRAGONBREATH_WATER:
case RK_DRAGONBREATH: {
struct status_change *tsc2 = NULL;
if( (tsc2 = status_get_sc(bl)) && (tsc2->data[SC_HIDING] )) {
clif_skill_nodamage(src,src,skill_id,skill_lv,1);
} else
skill_attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
}
break;

@reigneil
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and also about the Camouflage fixed it should be Cloak like behavior. /sry that i provided you wrong solution because i never tested it. now this time try this...
if (tsc->data[SC_CAMOUFLAGE] && !(is_boss || is_detect) && (!skill_id || (flag == 0 && src)))
return false;
what i do here is remove "src->type != BL_PC" thats all. so that target skill do hit if you are targeted before Camouflage take effect and ground skill hitting you similar to Cloaking behavior

@MrAntares
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aleos <3

Please sign in to comment.