-
Notifications
You must be signed in to change notification settings - Fork 772
Implement status reduction script command. #2246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement status reduction script command. #2246
Conversation
src/map/script.c
Outdated
| int val = script_getnum(st, 3);; | ||
| struct map_session_data *sd = script->rid2sd(st); | ||
|
|
||
| if (sd != NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be script error if sd not attached.
probably better return some error status in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait, aren't the script->rid2sd(st) would throw the error status if sd == NULL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i mean bit other. yes error in server console is fine
but current code also terminate npc script, because here no pushint in else branch.
if you add pushint also on errors, npc script can get result and continue running
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ops, rid2sd terminating script already. then probably better replace rid2sd to map->id2sd(st->rid)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think its better to remain script->rid2sd(st);.
the script command are designed for player to retrieve that status points.
Its fine to terminate the script if no player are attached to it, just like any other script commands like *statusup() etc
eae4dbc to
5166976
Compare
npc/other/CashShop_Functions.txt
Outdated
| // - Returns status points equals to points needed to raise | ||
| // that stat to original value. | ||
| // - Doesn't work if base status <type> would become lower than 1 after reduction. | ||
| // * callfunc("F_CashReduceStat",<type>{,<val>,<itemid>}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please correct the style issues in this function, spaces after , and if and parenthesis for script command calls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
- for stat reduction support. - return the amount of status point required to increase a status.
5166976 to
d7bbebd
Compare
Pull Request Prelude
Changes Proposed
Affected Branches: Master
Issues addressed: #1234
References rathena/rathena@51ef911
Known Issues and TODO List