diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-04-02 22:20:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-04-02 22:20:20 +0300 |
commit | 402cbb4310059bc37ffc2825b83a1659200bf12c (patch) | |
tree | 56faf21a6f91041fe25b9e6da31b66060e7c4f9c /src/map/pc.c | |
parent | 3a0767592d15288849ad16b6dcd9171af821af33 (diff) | |
download | evol-hercules-402cbb4310059bc37ffc2825b83a1659200bf12c.tar.gz evol-hercules-402cbb4310059bc37ffc2825b83a1659200bf12c.tar.bz2 evol-hercules-402cbb4310059bc37ffc2825b83a1659200bf12c.tar.xz evol-hercules-402cbb4310059bc37ffc2825b83a1659200bf12c.zip |
Add item_db attributes for limit item usage.
Added attributesRequiredStr, RequiredAgi, RequiredVit, RequiredInt,
RequiredDex, RequiredLuk.
Check this attributes before equip item.
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index a914653..d51cc2a 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -198,6 +198,20 @@ int epc_isequip_post(int retVal, struct map_session_data *sd, int *nPtr) if (n < 0 || n >= MAX_INVENTORY) return 0; + + struct ItemdExt *data = itemd_get(sd->inventory_data[n]); + if (!data) + return 1; + + if (sd->battle_status.str < data->requiredStr || + sd->battle_status.agi < data->requiredAgi || + sd->battle_status.vit < data->requiredVit || + sd->battle_status.int_ < data->requiredInt || + sd->battle_status.dex < data->requiredDex || + sd->battle_status.luk < data->requiredLuk) + { + return 0; + } } return retVal; } |