summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-10-21 19:32:06 +0200
committerGitHub <noreply@github.com>2017-10-21 19:32:06 +0200
commit58fdbea3d60eea1e6fcbc0dfcaddb85c7c3f1486 (patch)
tree8fafcb8a121e18217c6e50da66c72ca06795b09f
parent10acab2a7742f1257777c9b6e0d900d2729b9839 (diff)
parent2c2839c6cfb8e788115aa1858ddfbcf31ad3cd2c (diff)
downloadhercules-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
-rw-r--r--conf/messages.conf7
-rw-r--r--db/constants.conf3
-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
8 files changed, 17 insertions, 3 deletions
diff --git a/conf/messages.conf b/conf/messages.conf
index 155cfd881..78f0c6aa9 100644
--- a/conf/messages.conf
+++ b/conf/messages.conf
@@ -607,7 +607,10 @@
668: Shadow Chaser T
669: Summoner
-//670-855 FREE (please start using from the top if you need, leave the 670+ range for new jobs)
+//670-853 FREE (please start using from the top if you need, leave the 670+ range for new jobs)
+
+// Mapflag to disable Autoloot Commands
+854: Auto loot item are disabled on this map.
// MVP exp message issue clients 2013-12-23cRagexe and newer.
855: Congratulations! You are the MVP! Your reward EXP Points are %u !!
@@ -856,7 +859,7 @@
1060: NoWarp |
1061: NoWarpTo |
1062: NoReturn |
-//1063 FREE
+1063: NoAutoloot |
1064: NoMemo |
1065: No Exp Penalty: %s | No Zeny Penalty: %s
1066: On
diff --git a/db/constants.conf b/db/constants.conf
index bc06eed72..0015646dd 100644
--- a/db/constants.conf
+++ b/db/constants.conf
@@ -426,7 +426,8 @@ constants_db: {
mf_reset: 52
mf_notomb: 53
mf_nocashshop: 54
- mf_noviewid: 55
+ mf_noautoloot: 55
+ mf_noviewid: 56
comment__: "Cell Properties"
cell_walkable: 0
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
};