Kokak Posted April 15, 2019 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 15 Reputation: 0 Joined: 01/29/19 Last Seen: September 4, 2022 Share Posted April 15, 2019 (edited) Hi, I have successfully implemented a custom skill. I just have a problem about the Success Message and Skill Failed Message: When you have successfully break the enemy's weapon, the message must be "SUCCESS", and "Skill Failed" when you fail to break it. But, it always throws me the Skill Failed message even though I successfully break the weapon. Here is my code: case WS_CRUSHWEAPON: { int s = 0; skill_break_equip(src,bl, EQP_WEAPON, 150*skill_lv, BCT_ENEMY); clif_displaymessage(sd->fd, "SUCCESS."); if( sd && !s ){ clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); return 0; } clif_skill_nodamage(src,bl,skill_id,skill_lv,1); } break; Edited April 15, 2019 by Kokak Added info Quote Link to comment Share on other sites More sharing options...
2 Seravy Posted April 16, 2019 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 176 Reputation: 60 Joined: 01/11/19 Last Seen: March 12, 2021 Share Posted April 16, 2019 if (skill_break_equip(src,bl, EQP_WEAPON, 150*skill_lv, BCT_ENEMY)) { clif_displaymessage(sd->fd, "SUCCESS."); } else {clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);} is what you want then. 2 Quote Link to comment Share on other sites More sharing options...
0 Kokak Posted April 16, 2019 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 15 Reputation: 0 Joined: 01/29/19 Last Seen: September 4, 2022 Author Share Posted April 16, 2019 7 hours ago, Sakurada said: try adding a break after the skill works case WS_CRUSHWEAPON: { int s = 0; skill_break_equip(src,bl, EQP_WEAPON, 150*skill_lv, BCT_ENEMY); clif_displaymessage(sd->fd, "SUCCESS."); break; if( sd && !s ){ clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); return 0; } clif_skill_nodamage(src,bl,skill_id,skill_lv,1); } break; ah well we may have to change this around edit: cant fucking write with this........ but you just need to do something like this and break it in 2... and use clif_skill_nodamage in 2 spots... could be another way case SM_BASH: { int s = 0; skill_break_equip(src,bl, EQP_WEAPON, 150*skill_lv, BCT_ENEMY); clif_displaymessage(sd->fd, "SUCCESS."); clif_skill_nodamage(src,bl,skill_id,skill_lv,1); break; if( sd && !s ){ clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); return 0; } } break; Dont really know what your int s is so idk if you need to add it to that part.. its your % chance? then yeah i guess you do but not sure if i would place it under over over the return 0; so deal with it I tried doing this. Now it throws me "Success" always even though the skill failed to break the weapon. Quote Link to comment Share on other sites More sharing options...
0 Seravy Posted April 16, 2019 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 176 Reputation: 60 Joined: 01/11/19 Last Seen: March 12, 2021 Share Posted April 16, 2019 I don't see the most important "if" anywhere in there. if (skill_break_equip(src,bl, EQP_WEAPON, 150*skill_lv, BCT_ENEMY)) { clif_displaymessage(sd->fd, "SUCCESS."); } else {clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);} The return value from skill_break_equip tells you if it broke something or not. Quote Link to comment Share on other sites More sharing options...
0 Seravy Posted April 16, 2019 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 176 Reputation: 60 Joined: 01/11/19 Last Seen: March 12, 2021 Share Posted April 16, 2019 What matters, assuming the skill does try to break the equipment by calling skill_break_equip, "150*skillvl" is the chance of success. It'll return true if it did break something and false if it did not. It won't always break something. In addition to that, you also need to display "fail" if you didn't even call the function, like in your example if the monster is the wrong size. But I don't think he asked for that? Quote Link to comment Share on other sites More sharing options...
0 Kokak Posted April 16, 2019 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 15 Reputation: 0 Joined: 01/29/19 Last Seen: September 4, 2022 Author Share Posted April 16, 2019 10 minutes ago, Seravy said: What matters, assuming the skill does try to break the equipment by calling skill_break_equip, "150*skillvl" is the chance of success. It'll return true if it did break something and false if it did not. It won't always break something. In addition to that, you also need to display "fail" if you didn't even call the function, like in your example if the monster is the wrong size. But I don't think he asked for that? Yes, "150*SkillLvl" is the chance of success. It will only return a "SUCCESS" message whenever it did break the weapon. (Skill failed if not). Quote Link to comment Share on other sites More sharing options...
Question
Kokak
Hi, I have successfully implemented a custom skill.
I just have a problem about the Success Message and Skill Failed Message:
When you have successfully break the enemy's weapon, the message must be "SUCCESS", and "Skill Failed" when you fail to break it.
But, it always throws me the Skill Failed message even though I successfully break the weapon.
Here is my code:
Added info
Link to comment
Share on other sites
5 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.