Jump to content
  • 0

help doing SM_RECOVERY active skill (almost finished)


aleph075

Question


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.61
  • Content Count:  49
  • Reputation:   0
  • Joined:  04/10/24
  • Last Seen:  

Posted (edited)

I am trying to make Swordmans Recovery into an active skill.

I added the table to skill_db.yml (the cooldowns and durations seems to work)

Added the "activate" effects (the skill is activable, have mana cost, duration, and shows an "duration icon" at the left side of the screen)

But i dont know how to edit the status.cpp in order to make the ability only work when it's active.

For now, my SM_RECOVERY works ALL THE TIME as a pasive skill (no matter if you have the in-game skill activated or no)

I am not sure how  to edit this.... any help?

if( sd ) {
    struct regen_data_sub *sregen;
    if( (skill=pc_checkskill(sd,HP_MEDITATIO)) > 0 ) {
        val = regen->sp*(100+3*skill)/100;
        regen->sp = cap_value(val, 1, SHRT_MAX);
    }
/////-------------------THIS----------------------////
    if ((skill = pc_checkskill(sd, SM_RECOVERY)) > 0) {
        val += skill * 50 + skill * status->max_hp / 500; // just skill*50 for testing
        regen->hp = cap_value(val, 0, SHRT_MAX);
    }
////---------------------------------------------////
    // Only players have skill/sitting skill regen for now.
    sregen = regen->sregen;
Edited by aleph075
misstake
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

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

You need to make the skill give a status change (which I assume you did).

Then in the regen code you want to check for the status change instead of the skill being learned.

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.61
  • Content Count:  49
  • Reputation:   0
  • Joined:  04/10/24
  • Last Seen:  

On 5/7/2024 at 12:03 PM, Playtester said:

You need to make the skill give a status change (which I assume you did).

Then in the regen code you want to check for the status change instead of the skill being learned.

Not yet. But I will. I am not sure if already existe a status change for HP recovery, but i will. Thx bro

Link to comment
Share on other sites

  • 0

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

Currently there is no such status change but you could use the commented status change SC_HPREGEN and SC_SPREGEN. Uncomment them in status.hpp and in script_constants.hpp.

Then you need to define it in status.yml.

Then in skill_db.yml you link the skill to the status.

And then in the source code at the code where the skill is executed in skill.cpp you can just start it with:

sc_start(src,bl,type,100,skill_lv,skill_get_time(skill_id,skill_lv))

"type" contains the status that is linked to the skill in skill_db.yml, if you don't define it there you could also hardcode it here.

skill_get_time() means it uses Duration1 defined for the skill.

And then in the regen code you can just check if the status change is active

if(sc && sc->getSCE(SC_HPREGEN)) { 
  [...]
}

 

  • MVP 1
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...