diff options
author | Emistry Haoyan <equinox1991@gmail.com> | 2019-04-09 23:23:33 +0800 |
---|---|---|
committer | Emistry Haoyan <equinox1991@gmail.com> | 2019-06-03 02:49:39 +0800 |
commit | d20cbae7763546555c4c9c8aa53266c40b31a2b1 (patch) | |
tree | 02e237870182a20923f463dcb702dd57e1745e8d /src/map/pc.c | |
parent | e7d0f067d0a4cff9ec0693cf61225f06e93ef4f9 (diff) | |
download | hercules-d20cbae7763546555c4c9c8aa53266c40b31a2b1.tar.gz hercules-d20cbae7763546555c4c9c8aa53266c40b31a2b1.tar.bz2 hercules-d20cbae7763546555c4c9c8aa53266c40b31a2b1.tar.xz hercules-d20cbae7763546555c4c9c8aa53266c40b31a2b1.zip |
Add *setfavoriteitemidx & *autofavoriteitem script command.
- set an item as favorite item or not based inventory
index.
- if an item is set to favorite item, it will be moved into favorite
tab, else move out from favorite tab.
- only non-equipped item can adjust the favorite item state.
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 5416fbec2..fb023b2a4 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -4778,6 +4778,13 @@ static int pc_additem(struct map_session_data *sd, const struct item *item_data, sd->weight += w; clif->updatestatus(sd,SP_WEIGHT); + + // auto-favorite + if (data->flag.auto_favorite > 0) { + sd->status.inventory[i].favorite = 1; + clif->favorite_item(sd, i); + } + //Auto-equip if(data->flag.autoequip) pc->equipitem(sd, i, data->equip); |