diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-04-07 23:22:00 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-04-08 11:54:23 +0300 |
commit | 6916a2defdf884cceb67e6699bd9b4cfaeba0279 (patch) | |
tree | ba28b30664670182a96fea73f95a8b184144c062 /src/map/pc.c | |
parent | fd83c8bda2a4508ddf734e00c57b5699d4ea9cb7 (diff) | |
download | evol-hercules-6916a2defdf884cceb67e6699bd9b4cfaeba0279.tar.gz evol-hercules-6916a2defdf884cceb67e6699bd9b4cfaeba0279.tar.bz2 evol-hercules-6916a2defdf884cceb67e6699bd9b4cfaeba0279.tar.xz evol-hercules-6916a2defdf884cceb67e6699bd9b4cfaeba0279.zip |
Add to item_db.conf item attributes for use effects.
New attributes:
useEffect - send this effect to client if use item was success
useFailEffect - send this effect to client if use item was fail
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index fd03d01..79a3cac 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -201,7 +201,7 @@ int epc_isuseequip_post(int retVal, struct map_session_data *sd, int *nPtr) struct ItemdExt *data = itemd_get(sd->inventory_data[n]); if (!data) - return 1; + return retVal; if (sd->battle_status.str < data->requiredStr || sd->battle_status.agi < data->requiredAgi || @@ -223,3 +223,22 @@ int epc_isuseequip_post(int retVal, struct map_session_data *sd, int *nPtr) } return retVal; } + +int epc_useitem_post(int retVal, struct map_session_data *sd, int *nPtr) +{ + const int n = *nPtr; + if (!sd) + return retVal; + + if (n < 0 || n >= MAX_INVENTORY) + return retVal; + + struct ItemdExt *data = itemd_get(sd->inventory_data[n]); + if (!data) + return retVal; + + const int effect = retVal ? data->useEffect : data->useFailEffect; + if (effect != -1) + clif->specialeffect(&sd->bl, effect, AREA); + return retVal; +} |