Jump to content
  • 0

Sonic Blow / Arrow Vulcan animations on newer clients


ckx_

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  24
  • Reputation:   4
  • Joined:  06/29/22
  • Last Seen:  

I'd like to add the old Sonic Blow / Arrow Vulcan animations back to newer clients. Does anyone know where to begin on this? I believe it's a client-side change, but I am not entirely positive.

Background: I'm working on a pre-renewal server that uses a lot of newer renewal client features (market shops, randomopts, achievements, etc). So far I don't have any issues other than these skill animations being removed. Removal happened in kRO on 2018/12/19 (patch notes).

There are some old threads on the forums about this, but they're all dead ends. I'll link them anyway: Ref1, Ref2. The Herc Forums also have a thread for this.

If anyone has any info on this, let me know. Likewise I'll update the thread if I get anywhere myself.

Link to comment
Share on other sites

16 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  24
  • Reputation:   4
  • Joined:  06/29/22
  • Last Seen:  

Posted (edited)

I hackily solved this on the source side. A side effect of my solution is that it shows extra damage numbers (but the multihit total is still correct, and the extra damage numbers are visual only). My solution:

In the "display damage" switch block in skill_attack:

		case CG_ARROWVULCAN:
		case AS_SONICBLOW: {
			dmg.dmotion = clif_skill_damage(dsrc, bl, tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, flag & SD_LEVEL ? -1 : skill_lv, dmg_type, dmg.crit);
			struct unit_data* ud = unit_bl2ud(dsrc);
			if (ud) {
				ud->dmg = dmg;
				ud->sb_animation = 0;
				ud->sb_target = bl->id;
				ud->sb_timer = add_timer(gettick()+20, skill_sonicblow_animation, dsrc->id, 0);
			}
			break;
		}

↑ This plays the default SB animation, sets up some data, then adds a new timer function.

Here's the code for the timer_func it adds:

TIMER_FUNC(skill_sonicblow_animation){
	struct block_list *target, *src;
	struct unit_data *ud;
	struct status_change *sc = NULL;
	int flag = 0;

	src = map_id2bl(id);
	if(src == NULL) {
		return 0;
	}

	ud = unit_bl2ud(src);
	if(ud == NULL) {
		return 0;
	}
	target = map_id2bl(ud->sb_target);

	if (!target || ud->sb_animation >= ud->dmg.div_ || ud->sb_timer == INVALID_TIMER) {
		ud->sb_animation = 0;
		ud->sb_timer = INVALID_TIMER;
		return 0;
	}
	int div_ = ud->dmg.div_;
	if (div_ < 1) {
		div_ = 1;
	}
	t_tick canmove = tick_diff(ud->canmove_tick, tick);
	canmove /= (div_-ud->sb_animation);
	if (canmove > 175) {
		canmove = 175;
	}
	clif_damage(src, target, tick, 125, ud->dmg.dmotion/div_, ud->dmg.damage/div_, div_, DMG_NORMAL, ud->dmg.damage2/div_, ud->dmg.isspdamage);
	ud->sb_animation++;
	ud->sb_timer = add_timer(tick+canmove, skill_sonicblow_animation, id, data);
	return 1;
}

↑ This just sets up some damage then calls clif_damage, and sets up another timer func to keep it going until sb_animation reaches skill's div count. To be clear this will work for any multiattack that you want to have spam auto attacks, not just SB. Sorry for the naming scheme.

The extra damage numbers are customizable by changing what you pass to the clif_damage call. You can set it to all 1s, or all misses, or anything else. Unfortunately I never found a way to implement this without the extra numbers—I'm not sure how to force the client to arbitrarily play an auto attack animation with no corresponding damage numbers. If someone knows, I'd be interested.

and in the unit_data struct:

	int sb_animation, sb_target, sb_timer; // hacky sb animation fix

↑ just some state data, ud seemed like the best place to put it so that it works on both mobs and players.

This produces a sonic blow like in the attached file. also viewable here: https://mikomiko.org/files/Screencast_20240512_005716.webm

It's not perfect but I'm happy enough with it for now.

Edited by ckx_
added example webm
  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  21
  • Reputation:   2
  • Joined:  04/19/14
  • Last Seen:  

Could it be that Body Relocation (Skill ID# 264, iRO Name: Snap) is also without animation?

Edited by iJohn
I was too brief in words...
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  128
  • Topics Per Day:  0.03
  • Content Count:  659
  • Reputation:   84
  • Joined:  04/07/14
  • Last Seen:  

12 hours ago, ckx_ said:

I hackily solved this on the source side. A side effect of my solution is that it shows extra damage numbers (but the multihit total is still correct, and the extra damage numbers are visual only). My solution:

In the "display damage" switch block in skill_attack:

		case CG_ARROWVULCAN:
		case AS_SONICBLOW: {
			dmg.dmotion = clif_skill_damage(dsrc, bl, tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skill_id, flag & SD_LEVEL ? -1 : skill_lv, dmg_type, dmg.crit);
			struct unit_data* ud = unit_bl2ud(dsrc);
			if (ud) {
				ud->dmg = dmg;
				ud->sb_animation = 0;
				ud->sb_target = bl->id;
				ud->sb_timer = add_timer(gettick()+20, skill_sonicblow_animation, dsrc->id, 0);
			}
			break;
		}

↑ This plays the default SB animation, sets up some data, then adds a new timer function.

Here's the code for the timer_func it adds:

TIMER_FUNC(skill_sonicblow_animation){
	struct block_list *target, *src;
	struct unit_data *ud;
	struct status_change *sc = NULL;
	int flag = 0;

	src = map_id2bl(id);
	if(src == NULL) {
		return 0;
	}

	ud = unit_bl2ud(src);
	if(ud == NULL) {
		return 0;
	}
	target = map_id2bl(ud->sb_target);

	if (!target || ud->sb_animation >= ud->dmg.div_ || ud->sb_timer == INVALID_TIMER) {
		ud->sb_animation = 0;
		ud->sb_timer = INVALID_TIMER;
		return 0;
	}
	int div_ = ud->dmg.div_;
	if (div_ < 1) {
		div_ = 1;
	}
	t_tick canmove = tick_diff(ud->canmove_tick, tick);
	canmove /= (div_-ud->sb_animation);
	if (canmove > 175) {
		canmove = 175;
	}
	clif_damage(src, target, tick, 125, ud->dmg.dmotion/div_, ud->dmg.damage/div_, div_, DMG_NORMAL, ud->dmg.damage2/div_, ud->dmg.isspdamage);
	ud->sb_animation++;
	ud->sb_timer = add_timer(tick+canmove, skill_sonicblow_animation, id, data);
	return 1;
}

↑ This just sets up some damage then calls clif_damage, and sets up another timer func to keep it going until sb_animation reaches skill's div count. To be clear this will work for any multiattack that you want to have spam auto attacks, not just SB. Sorry for the naming scheme.

The extra damage numbers are customizable by changing what you pass to the clif_damage call. You can set it to all 1s, or all misses, or anything else. Unfortunately I never found a way to implement this without the extra numbers—I'm not sure how to force the client to arbitrarily play an auto attack animation with no corresponding damage numbers. If someone knows, I'd be interested.

and in the unit_data struct:

	int sb_animation, sb_target, sb_timer; // hacky sb animation fix

↑ just some state data, ud seemed like the best place to put it so that it works on both mobs and players.

This produces a sonic blow like in the attached file. also viewable here: https://mikomiko.org/files/Screencast_20240512_005716.webm

It's not perfect but I'm happy enough with it for now.

 

This is nice to those who are on 2019+ client. Keep it up!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  67
  • Topics Per Day:  0.02
  • Content Count:  225
  • Reputation:   30
  • Joined:  10/21/12
  • Last Seen:  

Posted (edited)

can we have the diff so we can fully understand where to add this codes?

thanks ❤️

 

image.thumb.png.16d6c42332c77011024057d361abff32.png

Edited by qtdan
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  128
  • Topics Per Day:  0.03
  • Content Count:  659
  • Reputation:   84
  • Joined:  04/07/14
  • Last Seen:  

Posted (edited)

Im trying this now as well. Can you direct me which file that needs to be edited? Or better yet a patch file. Thanks in advance!

Edited by Gidz Cross
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  48
  • Reputation:   2
  • Joined:  07/28/14
  • Last Seen:  

i hope there's an update for this one, espcially 2019+ clients 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  24
  • Reputation:   4
  • Joined:  06/29/22
  • Last Seen:  

My fork of rA is heavily modified, so a diff isn't easy for me to slap together. Sometime in the next few days I will find time to implement this fix on a clean rA and make a diff from there. I'll post another message here when I get around to it.

  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  67
  • Topics Per Day:  0.02
  • Content Count:  225
  • Reputation:   30
  • Joined:  10/21/12
  • Last Seen:  

that would be so much helpful @ckx_ Thanks in Advance ❤️

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.04
  • Content Count:  6
  • Reputation:   0
  • Joined:  03/05/24
  • Last Seen:  

thank you make a diff and post here ❤️

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  24
  • Reputation:   4
  • Joined:  06/29/22
  • Last Seen:  

Posted (edited)

I created a series of 2 mailbox patches (from format-patch). The mailbox patches probably work better than a diff (and gives a formal commit for the patch)

The patches are titled 0001-hacky-mutlihit-auto-attack-animation-fix-sonic-blow-.patch and 0002-add-status_delay_delete-to-cleanup-mobs-when-killed-.patch. I split it into two commits because I am not entirely confident my solution to freeing memory is the best, more on that in "Freeing unit memory" below.

Applying the mailbox patch

From within your rA directory (stat outputs some info, check is a dry run for validation):

git apply --stat 0001-hacky-mutlihit-auto-attack-animation-fix-sonic-blow-.patch
git apply --check 0001-hacky-mutlihit-auto-attack-animation-fix-sonic-blow-.patch
git am 0001-hacky-mutlihit-auto-attack-animation-fix-sonic-blow-.patch
git am 0002-add-status_delay_delete-to-cleanup-mobs-when-killed-.patch

Freeing unit memory - Not cleaining up properly?

Part of this fix is to add a new function, status_delay_delete, which checks if a mob was killed by Arrow Vulcan or Sonic Blow. It delays the cleanup of a dead mob, so that they are properly cleaned up after being killed by SB or AV. Right now this delayed deletion only applies to mobs, not to players. I have not tested this fix in any PVP environment and it is possible that players and other units are not cleaned up properly in some cases.

If this is the case, you will need to create a pc_timer_delete function and expand status_delay_delete to work with PCs. I am not motivated to do this right now. If someone tests this out in a pvp environment and finds that map blocks aren't being released properly, let me know, and I will probably do something about it.

Animation Timings

The code is commented with some info on how to change stuff like the animation timings, but to be clear, I did not do any comparison between official's classic Sonic Blow / AV and my default values. I just put what felt good to me. If someone else wants to get the official Sonic Blow timings and put them here, go for it.

Adding Multihit Skills

This patch has only been tested on pre-renewal with the skills Sonic Blow and Arrow Vulcan. If you want it to apply to other skills, you'll need to add them to the switch statement commented "//Display damage." in skill_attack (skill.cpp). Follow the case statements for CG_ARROWVULCAN / AS_SONICBLOW. You'll also need to add it to the conditional in status_delay_delete (status.cpp).

Quick NPC test script

Below is an npc script you can copy paste to test stuff out real fast:

@warp new_3-1 49, 109

new_3-1,53,95,1,4	monster	Phen	1158,30,3600000,1800000
new_3-1,49,107,1,4	script	BLOW IT	617,{
	BaseLevel += 99;
	jobchange(12);
	skill(136,10,SKILL_PERM_GRANT);
	statusup2(bDex,99);
	getitem(1250,1);
	equip(1250);
	return;
}
new_3-1,48,106,1,4	script	VULCAN IT	617,{
	BaseLevel += 99;
	jobchange(4020);
	skill(394,10,SKILL_PERM_GRANT);
	statusup2(bDex,99,getcharid(0));
	getitem(1953,1);
	getitem(1750,100);
	equip(1953);
	equip(1750);
	return;
}

0001-hacky-mutlihit-auto-attack-animation-fix-sonic-blow-.patch 0002-add-status_delay_delete-to-cleanup-mobs-when-killed-.patch

Edited by ckx_
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.04
  • Content Count:  6
  • Reputation:   0
  • Joined:  03/05/24
  • Last Seen:  

thank you!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  117
  • Reputation:   12
  • Joined:  06/22/13
  • Last Seen:  

Doesn't work on my 2022 client. rAthena trunk (latest)

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  24
  • Reputation:   4
  • Joined:  06/29/22
  • Last Seen:  

18 hours ago, Louis T Steinhil said:

Doesn't work on my 2022 client. rAthena trunk (latest)

I've only tested with a 2020 client. I'll test with a late 2022 or early 2023 client soon and post back. Did you get any changed behavior at all, or was it the same as before you applied the patch?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  117
  • Reputation:   12
  • Joined:  06/22/13
  • Last Seen:  

9 hours ago, ckx_ said:

I've only tested with a 2020 client. I'll test with a late 2022 or early 2023 client soon and post back. Did you get any changed behavior at all, or was it the same as before you applied the patch?

There is a change, it move quite a bit but not the same as you have that waves her hands around. Mine is just like split second movement then rapid duplicated numbers

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  24
  • Reputation:   4
  • Joined:  06/29/22
  • Last Seen:  

3 hours ago, Louis T Steinhil said:

There is a change, it move quite a bit but not the same as you have that waves her hands around. Mine is just like split second movement then rapid duplicated numbers

Try playing with these values:

Quote

+    t_tick canmove = tick_diff(ud->canmove_tick, tick) / (div_-ud->multihit_animation);
+    if (canmove > 175) {
+        canmove = 175;
+    }
+    clif_damage(src, target, tick, 125, ud->dmg.dmotion/div_, displayed_damage, div_, DMG_NORMAL, displayed_damage2, sp_damage);

The "canmove" value & and the "125" in the clif_damage call. If you mess with them a bit you might get better results. What you're describing might be less about client version and more about server tick, but I haven't tested newer clients yet. Maybe I'll get to it over the weekend.

Also I just realized the multihit_diff.patch file is only has the changes from the second commit, so it won't do anything. I removed the diff from the post.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  117
  • Reputation:   12
  • Joined:  06/22/13
  • Last Seen:  

5 hours ago, ckx_ said:

Try playing with these values:

The "canmove" value & and the "125" in the clif_damage call. If you mess with them a bit you might get better results. What you're describing might be less about client version and more about server tick, but I haven't tested newer clients yet. Maybe I'll get to it over the weekend.

Also I just realized the multihit_diff.patch file is only has the changes from the second commit, so it won't do anything. I removed the diff from the post.

this is the default 175, 125. I'll upload later if I get to see a difference

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...