diff options
author | Haru <haru@dotalux.com> | 2017-10-21 19:32:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-21 19:32:06 +0200 |
commit | 58fdbea3d60eea1e6fcbc0dfcaddb85c7c3f1486 (patch) | |
tree | 8fafcb8a121e18217c6e50da66c72ca06795b09f /src | |
parent | 10acab2a7742f1257777c9b6e0d900d2729b9839 (diff) | |
parent | 2c2839c6cfb8e788115aa1858ddfbcf31ad3cd2c (diff) | |
download | hercules-58fdbea3d60eea1e6fcbc0dfcaddb85c7c3f1486.tar.gz hercules-58fdbea3d60eea1e6fcbc0dfcaddb85c7c3f1486.tar.bz2 hercules-58fdbea3d60eea1e6fcbc0dfcaddb85c7c3f1486.tar.xz hercules-58fdbea3d60eea1e6fcbc0dfcaddb85c7c3f1486.zip |
Merge pull request #1833 from Emistry/mapflag_noautoloot
Add NoAutoloot mapflag
Diffstat (limited to 'src')
-rw-r--r-- | src/map/atcommand.c | 2 | ||||
-rw-r--r-- | src/map/map.h | 1 | ||||
-rw-r--r-- | src/map/mob.c | 1 | ||||
-rw-r--r-- | src/map/npc.c | 2 | ||||
-rw-r--r-- | src/map/script.c | 3 | ||||
-rw-r--r-- | src/map/script.h | 1 |
6 files changed, 10 insertions, 0 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 7b2c0f8b2..a59748b9e 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -3908,6 +3908,8 @@ ACMD(mapinfo) strcat(atcmd_output, msg_fd(fd,1096)); // PartyLock | if (map->list[m_id].flag.guildlock) strcat(atcmd_output, msg_fd(fd,1097)); // GuildLock | + if (map->list[m_id].flag.noautoloot) + strcat(atcmd_output, msg_fd(fd, 1063)); // NoAutoloot | if (map->list[m_id].flag.noviewid != EQP_NONE) strcat(atcmd_output, msg_fd(fd,1079)); // NoViewID | clif->message(fd, atcmd_output); diff --git a/src/map/map.h b/src/map/map.h index d4284b3f7..3221c73cd 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -852,6 +852,7 @@ struct map_data { unsigned noknockback : 1; unsigned notomb : 1; unsigned nocashshop : 1; + unsigned noautoloot : 1; uint32 noviewid; ///< noviewid (bitmask - @see enum equip_pos) } flag; struct point save; diff --git a/src/map/mob.c b/src/map/mob.c index 1fb46283d..822b84bf4 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -1904,6 +1904,7 @@ void mob_item_drop(struct mob_data *md, struct item_drop_list *dlist, struct ite if( sd && (drop_rate <= sd->state.autoloot || pc->isautolooting(sd, ditem->item_data.nameid)) + && (!map->list[sd->bl.m].flag.noautoloot) && (battle_config.idle_no_autoloot == 0 || DIFF_TICK(sockt->last_tick, sd->idletime) < battle_config.idle_no_autoloot) && (battle_config.homunculus_autoloot?1:!flag) #ifdef AUTOLOOT_DISTANCE diff --git a/src/map/npc.c b/src/map/npc.c index 6beff2b77..ecf7f878f 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -4300,6 +4300,8 @@ const char *npc_parse_mapflag(const char *w1, const char *w2, const char *w3, co map->list[m].flag.reset=state; else if (!strcmpi(w3,"notomb")) map->list[m].flag.notomb=state; + else if (!strcmpi(w3, "noautoloot")) + map->list[m].flag.noautoloot = state; else if (!strcmpi(w3,"adjust_unit_duration")) { int skill_id, k; char skill_name[MAP_ZONE_MAPFLAG_LENGTH], modifier[MAP_ZONE_MAPFLAG_LENGTH]; diff --git a/src/map/script.c b/src/map/script.c index e2f53088c..d2101d21f 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -12911,6 +12911,7 @@ BUILDIN(getmapflag) case MF_RESET: script_pushint(st,map->list[m].flag.reset); break; case MF_NOTOMB: script_pushint(st,map->list[m].flag.notomb); break; case MF_NOCASHSHOP: script_pushint(st,map->list[m].flag.nocashshop); break; + case MF_NOAUTOLOOT: script_pushint(st, map->list[m].flag.noautoloot); break; case MF_NOVIEWID: script_pushint(st,map->list[m].flag.noviewid); break; } } @@ -13035,6 +13036,7 @@ BUILDIN(setmapflag) { case MF_RESET: map->list[m].flag.reset = 1; break; case MF_NOTOMB: map->list[m].flag.notomb = 1; break; case MF_NOCASHSHOP: map->list[m].flag.nocashshop = 1; break; + case MF_NOAUTOLOOT: map->list[m].flag.noautoloot = 1; break; case MF_NOVIEWID: map->list[m].flag.noviewid = (val <= 0) ? EQP_NONE : val; break; } } @@ -13122,6 +13124,7 @@ BUILDIN(removemapflag) { case MF_RESET: map->list[m].flag.reset = 0; break; case MF_NOTOMB: map->list[m].flag.notomb = 0; break; case MF_NOCASHSHOP: map->list[m].flag.nocashshop = 0; break; + case MF_NOAUTOLOOT: map->list[m].flag.noautoloot = 0; break; case MF_NOVIEWID: map->list[m].flag.noviewid = EQP_NONE; break; } } diff --git a/src/map/script.h b/src/map/script.h index 189122230..283afa496 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -336,6 +336,7 @@ enum { MF_RESET, MF_NOTOMB, MF_NOCASHSHOP, + MF_NOAUTOLOOT, MF_NOVIEWID }; |