aleph075 Posted May 5 Group: Members Topic Count: 23 Topics Per Day: 0.42 Content Count: 49 Reputation: 0 Joined: 04/10/24 Last Seen: May 21 Share Posted May 5 (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 May 6 by aleph075 misstake Quote Link to comment Share on other sites More sharing options...
0 Playtester Posted May 7 Group: Developer Topic Count: 35 Topics Per Day: 0.01 Content Count: 818 Reputation: 237 Joined: 01/30/13 Last Seen: 33 minutes ago Share Posted May 7 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. 1 Quote Link to comment Share on other sites More sharing options...
0 aleph075 Posted May 8 Group: Members Topic Count: 23 Topics Per Day: 0.42 Content Count: 49 Reputation: 0 Joined: 04/10/24 Last Seen: May 21 Author Share Posted May 8 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 Quote Link to comment Share on other sites More sharing options...
0 Playtester Posted May 9 Group: Developer Topic Count: 35 Topics Per Day: 0.01 Content Count: 818 Reputation: 237 Joined: 01/30/13 Last Seen: 33 minutes ago Share Posted May 9 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)) { [...] } 1 Quote Link to comment Share on other sites More sharing options...
Question
aleph075
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 aleph075misstake
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.