Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Multi Critical Damage #2673

Open
wants to merge 5 commits into
base: stable
Choose a base branch
from
Open

Implement Multi Critical Damage #2673

wants to merge 5 commits into from

Conversation

jenkijo
Copy link
Contributor

@jenkijo jenkijo commented Mar 30, 2020

Pull Request Prelude

  • I have followed [proper Hercules code styling][code].
  • I have read and understood the [contribution guidelines][cont] before making this PR.
  • I am aware that this PR may be closed if the above-mentioned criteria are not fulfilled.

Changes Proposed

Official behavior: http://ro.gnjoy.com/news/notice/View.asp?BBSMode=10001&seq=6726&curpage=1

  • Counter Attack
  • Focused Arrow Strike
  • Chain Action
  • Shadow Slash
  • Double Attack
  • Fear Breeze
  • Triple Attack

This PR original make by @ghost, but he is deleted his account, so this PR has been closed before, I just reopen it

Credits:
@secretdataz
@ghost

Issues addressed:
#1558

@@ -4906,8 +4907,10 @@ static int clif_damage(struct block_list *src, struct block_list *dst, int sdela
unit->set_dir(src, unit->getdir(src));
}

// In case this assignment is bypassed by BDT_MULTICRIT
type = clif_calc_delay(type, div, damage + damage2, ddelay);
Copy link
Contributor

Choose a reason for hiding this comment

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

this is designed to call clif_calc_delay twice if type is not BDT_MULTICRIT? or this is error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's design to call twice

Copy link
Member

@Emistry Emistry left a comment

Choose a reason for hiding this comment

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

Due to it depend on certain PACKETVER , when startup and load the configuration, it should auto disable this feature if user has turned this on with a not compatible packet version.

find static void battle_adjust_conf(void)
then add something like this:

#if PACKETVER < 20161207
	if( battle_config.feature_enable_multi_crit ) {
		ShowWarning("conf/map/battle/feature.conf feature_enable_multi_crit is enabled but it requires PACKETVER 2016-12-07 or newer, disabling...\n");
		battle_config.feature_enable_multi_crit = 0;
	}
#endif

conf/map/battle/feature.conf Outdated Show resolved Hide resolved
src/map/battle.c Outdated Show resolved Hide resolved
src/map/battle.c Outdated Show resolved Hide resolved
conf/map/battle/feature.conf Outdated Show resolved Hide resolved
src/map/skill.c Outdated Show resolved Hide resolved

// Enable Multi-Critical damage
// Requires: 2016-12-07 RagexeRE or later
enable_multi_critical: true
Copy link
Contributor

Choose a reason for hiding this comment

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

please set this to false otherwise the CI that checks different client types would fail

@@ -4470,7 +4468,7 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src, struct bl

case TF_DOUBLE: //For NPC used skill.
case GS_CHAINACTION:
wd.type = BDT_MULTIHIT;
wd.type = BDT_CRIT | BDT_MULTICRIT;
Copy link
Contributor

Choose a reason for hiding this comment

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

BDT_* is not a bitmask, is this intended? also this will break pre-re compatibility please add it under #ifdef.

|| ( sc && sc->data[SC_KAGEMUSYA] && sd->weapontype1 != W_FIST ) // Need confirmation
if (sd->bonus.double_rate > 0
|| (skill_lv = pc->checkskill(sd, TF_DOUBLE)) > 0
|| (sc != NULL && sc->data[SC_KAGEMUSYA] != NULL)
Copy link
Contributor

Choose a reason for hiding this comment

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

all of this changes should be put under #ifdef RENEWAL

) {
//Success chance is not added, the higher one is used [Skotlex]
if( rnd()%100 < ( 5*skill_lv > sd->bonus.double_rate ? 5*skill_lv : sc && sc->data[SC_KAGEMUSYA]?sc->data[SC_KAGEMUSYA]->val1*3:sd->bonus.double_rate ) )
{
wd.div_ = skill->get_num(TF_DOUBLE,skill_lv?skill_lv:1);
wd.type = BDT_MULTIHIT;
wd.type = BDT_CRIT | BDT_MULTICRIT;
Copy link
Contributor

Choose a reason for hiding this comment

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

all of this changes should be put under #ifdef RENEWAL

}
}
else if( sd->weapontype1 == W_REVOLVER && (skill_lv = pc->checkskill(sd,GS_CHAINACTION)) > 0 && rnd()%100 < 5*skill_lv )
{
wd.div_ = skill->get_num(GS_CHAINACTION,skill_lv);
wd.type = BDT_MULTIHIT;
wd.type = BDT_CRIT | BDT_MULTICRIT;
Copy link
Contributor

Choose a reason for hiding this comment

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

all of this changes should be put under #ifdef RENEWAL

@@ -4646,17 +4644,13 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src, struct bl
if ( wd.div_ > 1 ) {
wd.div_ = min(wd.div_, sd->status.inventory[i].amount);
sc->data[SC_FEARBREEZE]->val4 = wd.div_ - 1;
wd.type = BDT_MULTIHIT;
wd.type = BDT_CRIT | BDT_MULTICRIT;
Copy link
Contributor

Choose a reason for hiding this comment

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

all of this changes should be put under #ifdef RENEWAL

skill_id == KN_AUTOCOUNTER ||
skill_id == SN_SHARPSHOOTING || skill_id == MA_SHARPSHOOTING ||
skill_id == NJ_KIRIKAGE))
if (sstatus->cri != 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

all of this changes should be put under #ifdef RENEWAL

case SN_SHARPSHOOTING:
case MA_SHARPSHOOTING:
case NJ_KIRIKAGE:
dmg.dmotion = clif->damage(src, bl, dmg.amotion, dmg.dmotion, damage, dmg.div_, dmg.type, dmg.damage2);
Copy link
Contributor

Choose a reason for hiding this comment

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

all of this changes should be put under #ifdef RENEWAL

@MrKeiKun
Copy link
Contributor

can i request for a rebase for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants