Jump to content
  • 0

How to make single target skill into AoE?


OasisRO

Question


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.01
  • Content Count:  5
  • Reputation:   0
  • Joined:  05/09/22
  • Last Seen:  

Hi, I'm sure this has been asked before but the search gave me so many unrelated results I'm not even sure I know how to search the forums here.

I'm trying to learn how to edit skills, and I've managed to figure out a few things, but so far I'm pretty stumped on the AoE portion of skills.
For example, I'm trying to make Acid Terror into an AoE. I have made it into a multi hit skill, and made it not reduce the amount of acid bottles by editing the skill_db.yml.

I tried to copy the text from fireball and magnum break without any results on either, and I found one vague message on the discord when searching that said "you can't just edit the skill_db to make something an aoe" but it didn't clarify how to actually do it. (not trying to being rude just saying.)

Should I go into the skill.cpp and change something there or is there another way that I'm not understanding. The formulas in the skill.cpp make me really nervous because I don't want to make any drastic changes and I was worried about breaking something in there.

Anyway, if anyone could give me a baby mode breakdown of like "first do this, then do this, and then finish by doing this" I would really appreciate it. I just started learning to do this last night with an offline build because all the lawsuit stuff has me anxious I won't be able to play ro again in the future lol.

I'll post the code I have in the skill_db for reference so you can see if I'm messing that up. I believe I took this one from Mag Break.

Oh I think I'm supposed to say the client is 2021 11 17?

 

  - Id: 230
    Name: AM_ACIDTERROR
    Description: Acid Terror
    MaxLevel: 5
    Type: Weapon
    TargetType: Attack
    DamageFlags:
      Splash: true
      IgnoreFlee: true
    Flags:
      IgnoreAutoGuard: true
      IgnoreCicada: true
    Range: 9
    Hit: Single
    HitCount: 1
    SplashArea:
      - Level: 1
        Area: 2
      - Level: 2
        Area: 2
      - Level: 3
        Area: 2
      - Level: 4
        Area: 4
      - Level: 5
        Area: 4
    CopyFlags:
      Skill:
        Plagiarism: true
        Reproduce: true
    CastCancel: true
    CastTime: 1000
    Duration1:
      - Level: 1
        Time: 5
      - Level: 2
        Time: 5
      - Level: 3
        Time: 5
      - Level: 4
        Time: 5
      - Level: 5
        Time: 5
    Duration2: 120000

 

Edited by OasisRO
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  812
  • Reputation:   234
  • Joined:  01/30/13
  • Last Seen:  

Yeah basically you need to edit skill.cpp, but the change should be minimal if you have a different skill that works similar already.

Basically open skill.cpp in Visual Studio and make Ctrl+F, make sure you select to search only in this document so you don't get too many results.

Then you first search for the skill you want to change to understand how it works. You don't want to change anything about its effects, you just want to change how often it calls "skill_attack" (you want to call it once for each enemy in the area instead of just the target).

So if you search for AM_ACIDTERROR in skill.cpp and check where it calls skill_attack you will find it in a long lists of single target skills:

[...]
	case AC_CHARGEARROW:
	case MA_CHARGEARROW:
	case RG_INTIMIDATE:
	case AM_ACIDTERROR:
	case BA_MUSICALSTRIKE:
	case DC_THROWARROW:
	case BA_DISSONANCE:
	case CR_HOLYCROSS:
[...]

You will want to remove it here.

Now you search for a skill that you want it to behave like. For example MG_FIREBALL. Then you find a larger list of skills, it's even commented as "Splash skills":

	//Splash attack skills.
	case AS_GRIMTOOTH:
	case MC_CARTREVOLUTION:
	case NPC_SPLASHATTACK:
		flag |= SD_PREAMBLE; // a fake packet will be sent for the first target to be hit
	case AS_SPLASHER:
	case HT_BLITZBEAT:
	case AC_SHOWER:
	case MA_SHOWER:
	case MG_NAPALMBEAT:
	case MG_FIREBALL:
	case RG_RAID:
#ifdef RENEWAL
	case SN_SHARPSHOOTING:
#endif
	case HW_NAPALMVULCAN:
	case NJ_HUUMA:
	case ASC_METEORASSAULT:

You just need to add your skill here ("case AM_ACIDTERROR:").

Now it works like a splash skill. The code below looks a bit scary because devs put way too many exceptions in there, but you can just ignore this unless you want your skill to have a unique handling unlike normal splash skills.

Most of the other things you can just define in the skill_db.yml

If you wonder how this section works, basically it will first be called without a flag:

        if( flag&1 ) {//Recursive invocation

So this will be false and it goes into the else:

        } else {

In the else it then calls a sub function for all units in the area:

            // recursive invocation of skill_castend_damage_id() with flag|1
            map_foreachinrange(skill_area_sub, bl, splash_size, starget, src, skill_id, skill_lv, tick, flag|BCT_ENEMY|SD_SPLASH|1, skill_castend_damage_id);

This will in the end loop back to the same function again for each valid target, except now it has "flag&1" and will just call skill_attack for that target instead.

  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.01
  • Content Count:  5
  • Reputation:   0
  • Joined:  05/09/22
  • Last Seen:  

Just now, Playtester said:

Yeah basically you need to edit skill.cpp, but the change should be minimal if you have a different skill that works similar already.

Basically open skill.cpp in Visual Studio and make Ctrl+F, make sure you select to search only in this document so you don't get too many results.

Then you first search for the skill you want to change to understand how it works. You don't want to change anything about its effects, you just want to change how often it calls "skill_attack" (you want to call it once for each enemy in the area instead of just the target).

So if you search for AM_ACIDTERROR in skill.cpp and check where it calls skill_attack you will find it in a long lists of single target skills:

[...]
	case AC_CHARGEARROW:
	case MA_CHARGEARROW:
	case RG_INTIMIDATE:
	case AM_ACIDTERROR:
	case BA_MUSICALSTRIKE:
	case DC_THROWARROW:
	case BA_DISSONANCE:
	case CR_HOLYCROSS:
[...]

You will want to remove it here.

Now you search for a skill that you want it to behave like. For example MG_FIREBALL. Then you find a larger list of skills, it's even commented as "Splash skills":

	//Splash attack skills.
	case AS_GRIMTOOTH:
	case MC_CARTREVOLUTION:
	case NPC_SPLASHATTACK:
		flag |= SD_PREAMBLE; // a fake packet will be sent for the first target to be hit
	case AS_SPLASHER:
	case HT_BLITZBEAT:
	case AC_SHOWER:
	case MA_SHOWER:
	case MG_NAPALMBEAT:
	case MG_FIREBALL:
	case RG_RAID:
#ifdef RENEWAL
	case SN_SHARPSHOOTING:
#endif
	case HW_NAPALMVULCAN:
	case NJ_HUUMA:
	case ASC_METEORASSAULT:

You just need to add your skill here ("case AM_ACIDTERROR:").

Now it works like a splash skill. The code below looks a bit scary because devs put way too many exceptions in there, but you can just ignore this unless you want your skill to have a unique handling unlike normal splash skills.

Most of the other things you can just define in the skill_db.yml

If you wonder how this section works, basically it will first be called without a flag:

        if( flag&1 ) {//Recursive invocation

So this will be false and it goes into the else:

        } else {

In the else it then calls a sub function for all units in the area:

            // recursive invocation of skill_castend_damage_id() with flag|1
            map_foreachinrange(skill_area_sub, bl, splash_size, starget, src, skill_id, skill_lv, tick, flag|BCT_ENEMY|SD_SPLASH|1, skill_castend_damage_id);

This will in the end loop back to the same function again for each valid target, except now it has "flag&1" and will just call skill_attack for that target instead.

Ahaha. Thank you so much for this. It definitely clarified what I was literally on my way to try and poorly explain how I got it working for anyone searching in the future. I literally just now managed to get it working. You did it so perfectly, thank you again.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.05
  • Content Count:  478
  • Reputation:   14
  • Joined:  11/30/17
  • Last Seen:  

how can i only allow the splashing of skill when being in soul link state only?

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  812
  • Reputation:   234
  • Joined:  01/30/13
  • Last Seen:  

45 minutes ago, kalabasa said:

how can i only allow the splashing of skill when being in soul link state only?

You could for example check for the Soul Link status change and if you don't have it just call skill_attack directly, otherwise call map_foreachinrange as for other splash skills.

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...