summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorJedzkie <jedzkie13@rocketmail.com>2017-04-21 15:49:47 +0800
committerHaru <haru@dotalux.com>2018-04-22 19:53:10 +0200
commite3d63fbd38df18ebe8ef8efdb22dd03fc0220926 (patch)
tree0dc3a4660d421bb723870fc9ee6e51040efbc5c8 /src/map/status.c
parent01902e6393f6a750ee320e63f9092a981ce72696 (diff)
downloadhercules-e3d63fbd38df18ebe8ef8efdb22dd03fc0220926.tar.gz
hercules-e3d63fbd38df18ebe8ef8efdb22dd03fc0220926.tar.bz2
hercules-e3d63fbd38df18ebe8ef8efdb22dd03fc0220926.tar.xz
hercules-e3d63fbd38df18ebe8ef8efdb22dd03fc0220926.zip
Fixes interaction between Curse and Blessing
When under Curse or Stone Curse, Blessing will only remove the negative statuses. Blessing needs to be cast twice to obtain the buff. Fixes #680 Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/map/status.c b/src/map/status.c
index b2f67735b..a39449b11 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -10189,8 +10189,8 @@ void status_change_start_stop_action(struct block_list *bl, enum sc_type type)
* @param val3 Additional value (meaning depends on type).
* @param val4 Additional value (meaning depends on type).
*
- * @retval 0 if no status change happened.
- * @retval 1 if the status change was successfully applied.
+ * @retval false if no status change happened, or the other sc can be started regardless.
+ * @retval true if the status change was successfully applied and the other sc shouldn't be started.
*/
bool status_end_sc_before_start(struct block_list *bl, struct status_data *st, struct status_change* sc, enum sc_type type, int undead_flag, int val1, int val2, int val3, int val4)
{
@@ -10200,14 +10200,22 @@ bool status_end_sc_before_start(struct block_list *bl, struct status_data *st, s
switch (type) {
case SC_BLESSING:
- //TO-DO Blessing and Agi up should do 1 damage against players on Undead Status, even on PvM
- //but cannot be plagiarized (this requires aegis investigation on packets and official behavior) [Brainstorm]
- if ((!undead_flag && st->race != RC_DEMON) || bl->type == BL_PC) {
- status_change_end(bl, SC_CURSE, INVALID_TIMER);
- if (sc->data[SC_STONE] && sc->opt1 == OPT1_STONE)
+ // TODO: Blessing and Agi up should do 1 damage against players on Undead Status, even on PvM
+ // but cannot be plagiarized (this requires aegis investigation on packets and official behavior) [Brainstorm]
+ if ((undead_flag == 0 && st->race != RC_DEMON) || bl->type == BL_PC) {
+ bool prevent_start = false;
+ if (sc->data[SC_CURSE] != NULL) {
+ prevent_start = true;
+ status_change_end(bl, SC_CURSE, INVALID_TIMER);
+ }
+ if (sc->data[SC_STONE] != NULL && sc->opt1 == OPT1_STONE) {
+ prevent_start = true;
status_change_end(bl, SC_STONE, INVALID_TIMER);
+ }
+ if (prevent_start)
+ return true;
}
- if (sc->data[SC_SOULLINK] && sc->data[SC_SOULLINK]->val2 == SL_HIGH)
+ if (sc->data[SC_SOULLINK] != NULL && sc->data[SC_SOULLINK]->val2 == SL_HIGH)
status_change_end(bl, SC_SOULLINK, INVALID_TIMER);
break;
case SC_INC_AGI: