Was able to follow it through for the most part, though some of the format/coding used now is different from that put forth in the wiki. What I'm trying to do is incorporate a players total equipped weight into a damage reduction of a kind.
Essentially, I'd like to take 10% of any given equipment's weight, convert that into a variable bonus to reduce damage by a percentage. I've defined the variables and created three new classifications for the bonus (I think) but I'm not actually sure how to implement the coding in battle.c. or if any other files would need to be edited. Any advice would be appreciated. The following files have been edited so far:
map.hpp
pc.hpp
status.cpp
pc.cpp
const.txt
Edit: I'm currently thinking of using the following code for grabbing equipment weight:
short index = sd->equip_index[insert equipment piece here];
Question
Synel
I've read through the wiki here: https://github.com/rathena/rathena/wiki/Adding-New-Bonuses
Was able to follow it through for the most part, though some of the format/coding used now is different from that put forth in the wiki. What I'm trying to do is incorporate a players total equipped weight into a damage reduction of a kind.
Essentially, I'd like to take 10% of any given equipment's weight, convert that into a variable bonus to reduce damage by a percentage. I've defined the variables and created three new classifications for the bonus (I think) but I'm not actually sure how to implement the coding in battle.c. or if any other files would need to be edited. Any advice would be appreciated. The following files have been edited so far:
map.hpp
pc.hpp
status.cpp
pc.cpp
const.txt
Edit: I'm currently thinking of using the following code for grabbing equipment weight:
short index = sd->equip_index[insert equipment piece here];
if (index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == IT_ARMOR)
Edited by Synelskillratio += sd->inventory_data[index]->weight / 10;
Link to comment
Share on other sites
4 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.