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

bAutoSpellOnSkill incorrectly functioning #8256

Open
Badarosk0 opened this issue Apr 18, 2024 · 3 comments · May be fixed by #8266
Open

bAutoSpellOnSkill incorrectly functioning #8256

Badarosk0 opened this issue Apr 18, 2024 · 3 comments · May be fixed by #8266
Labels
type:bug Issue that is a bug within rAthena

Comments

@Badarosk0
Copy link

Badarosk0 commented Apr 18, 2024

rAthena Hash

cdf377e

Client Date

2023-11-03

Server Mode

Renewal

Result

bonus4 bAutoSpellOnSkill is generating multiple activations. You will notice this when you add a high activation value, for example 100%.

Gravando_2024-03-13_125435.mp4

Note that in the video the number of Meteor Storm called is high.

Each time the target is hit, a new Meteor Storm skill is generated.

This will also occur with other skills.

Relevant Log Output

No response

Expected Result

When using a skill in autospell, the other skill should be called by the use of the previous skill and not by hits that hit the target.

How to Reproduce

Add this script to any item and test it.

bonus4 bAutoSpellOnSkill,"WZ_STORMGUST","WZ_METEOR",getskilllv("WZ_METEOR"),1000;

Official Information

Here we have a video of a dimension combo item used in kRO recently. This combo uses exactly this script bonus. In the video you will notice that in kRO the call of the other skill is due to the use of the skill.

https://youtu.be/dA0Id65T3mM?si=4ZP4J_6OVJ1nWCFJ

  - Combos:
      - Combo:
          - Dimen_HN_Rod   # 550133
          - Time_DM_R_Crown_HN   # 400545
    Script: |
      bonus2 bMagicAtkEle,Ele_Earth,10;
      bonus2 bMagicAtkEle,Ele_Fire,10;
      bonus2 bMagicAtkEle,Ele_Ghost,30;
      bonus2 bSkillAtk,"HN_NAPALM_VULCAN_STRIKE",45;
      if (getenchantgrade(EQI_HAND_R)>=ENCHANTGRADE_A && getenchantgrade(EQI_HEAD_TOP)>=ENCHANTGRADE_A) {
         .@sum = getequiprefinerycnt(EQI_HAND_R)+getequiprefinerycnt(EQI_HEAD_TOP);
         bonus2 bSkillAtk,"HN_NAPALM_VULCAN_STRIKE",.@sum;
         bonus4 bAutoSpellOnSkill,"HN_NAPALM_VULCAN_STRIKE","AG_SOUL_VC_STRIKE",5,500;
      }

Modifications that may affect results

No response

@Badarosk0 Badarosk0 added the type:bug Issue that is a bug within rAthena label Apr 18, 2024
@vstumpf
Copy link
Member

vstumpf commented Apr 21, 2024

Looks like the issue is with this call to skill_onskillusage inside skill_attack

rathena/src/map/skill.cpp

Lines 4141 to 4142 in 75f5188

if( sd )
skill_onskillusage(sd, bl, skill_id, tick);

vstumpf added a commit to vstumpf/rathena that referenced this issue Apr 21, 2024
@Badarosk0
Copy link
Author

Looks like the issue is with this call to skill_onskillusage inside skill_attack

rathena/src/map/skill.cpp

Lines 4141 to 4142 in 75f5188

if( sd )
skill_onskillusage(sd, bl, skill_id, tick);

Very good, this solves the issue.

@Badarosk0
Copy link
Author

Badarosk0 commented Apr 28, 2024

Looks like the issue is with this call to skill_onskillusage inside skill_attack

rathena/src/map/skill.cpp

Lines 4141 to 4142 in 75f5188

if( sd )
skill_onskillusage(sd, bl, skill_id, tick);

I noticed that now after this change, some bAutoSpellOnSkill seems to not work well. This example below does not work and before this change it worked.

bonus4 bAutoSpellOnSkill,"RK_DRAGONBREATH","RK_DRAGONBREATH_WATER",5,1000;

When using RK_DRAGONBREATH nothing happens, the skill RK_DRAGONBREATH_WATER is not called

Could it be a problem associated with TargetType: Ground ?

Well, I removed it out of the conditional like this:

	if(sd)
		skill_onskillusage(sd,bl,skill_id,skill_lv);

	if( sd && !(flag&1) )
	{// ensure that the skill last-cast tick is recorded
		sd->canskill_tick = gettick();

		if( sd->state.arrow_atk )
		{// consume arrow on last invocation to this skill.
			battle_consume_ammo(sd, skill_id, skill_lv);
		}

		//skill_onskillusage(sd,bl,skill_id,skill_lv);
		// perform skill requirement consumption
		if (!(flag&SKILL_NOCONSUME_REQ))
			skill_consume_requirement(sd,skill_id,skill_lv,2);
	}
	```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Issue that is a bug within rAthena
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants