summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorEmistry Haoyan <Equinox1991@gmail.com>2017-08-28 01:12:06 +0800
committerEmistry Haoyan <Equinox1991@gmail.com>2017-10-22 00:15:06 +0800
commit2c2839c6cfb8e788115aa1858ddfbcf31ad3cd2c (patch)
tree8fc2bf5e0a3915d1adff34efc01517944acfc894 /src/map
parent7c2f6afe542bf42f1c527877bde082274c473f29 (diff)
downloadhercules-2c2839c6cfb8e788115aa1858ddfbcf31ad3cd2c.tar.gz
hercules-2c2839c6cfb8e788115aa1858ddfbcf31ad3cd2c.tar.bz2
hercules-2c2839c6cfb8e788115aa1858ddfbcf31ad3cd2c.tar.xz
hercules-2c2839c6cfb8e788115aa1858ddfbcf31ad3cd2c.zip
Add NoAutoloot mapflag
- Enable server to disable autoloot settings for certain maps.
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.c2
-rw-r--r--src/map/map.h1
-rw-r--r--src/map/mob.c1
-rw-r--r--src/map/npc.c2
-rw-r--r--src/map/script.c3
-rw-r--r--src/map/script.h1
6 files changed, 10 insertions, 0 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 872c31330..6f367b406 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -3906,6 +3906,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 98f8865a9..42195def9 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 8722fcdbe..d5a05164f 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -12833,6 +12833,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;
}
}
@@ -12957,6 +12958,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;
}
}
@@ -13044,6 +13046,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
};