summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/HPMmap.c42
-rw-r--r--src/map/atcommand.c67
-rw-r--r--src/map/atcommand.h2
-rw-r--r--src/map/battle.c61
-rw-r--r--src/map/battle.h2
-rw-r--r--src/map/battleground.c33
-rw-r--r--src/map/battleground.h2
-rw-r--r--src/map/buyingstore.c17
-rw-r--r--src/map/buyingstore.h5
-rw-r--r--src/map/chat.c23
-rw-r--r--src/map/chat.h5
-rw-r--r--src/map/chrif.c35
-rw-r--r--src/map/chrif.h4
-rw-r--r--src/map/clif.c83
-rw-r--r--src/map/clif.h9
-rw-r--r--src/map/date.c6
-rw-r--r--src/map/date.h2
-rw-r--r--src/map/duel.c10
-rw-r--r--src/map/duel.h4
-rw-r--r--src/map/elemental.c54
-rw-r--r--src/map/elemental.h1
-rw-r--r--src/map/guild.c47
-rw-r--r--src/map/guild.h16
-rw-r--r--src/map/homunculus.c56
-rw-r--r--src/map/homunculus.h3
-rw-r--r--src/map/instance.c34
-rw-r--r--src/map/instance.h3
-rw-r--r--src/map/intif.c51
-rw-r--r--src/map/intif.h13
-rw-r--r--src/map/irc-bot.c22
-rw-r--r--src/map/irc-bot.h2
-rw-r--r--src/map/itemdb.c27
-rw-r--r--src/map/itemdb.h5
-rw-r--r--src/map/log.c23
-rw-r--r--src/map/log.h5
-rw-r--r--src/map/mail.c16
-rw-r--r--src/map/mail.h6
-rw-r--r--src/map/map.c96
-rw-r--r--src/map/map.h9
-rw-r--r--src/map/mapreg_sql.c14
-rw-r--r--src/map/mercenary.c54
-rw-r--r--src/map/mercenary.h1
-rw-r--r--src/map/mob.c69
-rw-r--r--src/map/mob.h9
-rw-r--r--src/map/npc.c57
-rw-r--r--src/map/npc.h4
-rw-r--r--src/map/npc_chat.c26
-rw-r--r--src/map/party.c43
-rw-r--r--src/map/party.h7
-rw-r--r--src/map/path.c17
-rw-r--r--src/map/path.h1
-rw-r--r--src/map/pc.c59
-rw-r--r--src/map/pc.h29
-rw-r--r--src/map/pc_groups.c14
-rw-r--r--src/map/pc_groups.h4
-rw-r--r--src/map/pet.c48
-rw-r--r--src/map/pet.h10
-rw-r--r--src/map/quest.c45
-rw-r--r--src/map/quest.h4
-rw-r--r--src/map/script.c79
-rw-r--r--src/map/script.h12
-rw-r--r--src/map/searchstore.c11
-rw-r--r--src/map/searchstore.h6
-rw-r--r--src/map/skill.c64
-rw-r--r--src/map/skill.h14
-rw-r--r--src/map/status.c59
-rw-r--r--src/map/status.h16
-rw-r--r--src/map/storage.c32
-rw-r--r--src/map/storage.h5
-rw-r--r--src/map/trade.c24
-rw-r--r--src/map/unit.c63
-rw-r--r--src/map/unit.h12
-rw-r--r--src/map/vending.c27
-rw-r--r--src/map/vending.h1
74 files changed, 996 insertions, 845 deletions
diff --git a/src/map/HPMmap.c b/src/map/HPMmap.c
index 061479d87..cb8c979c6 100644
--- a/src/map/HPMmap.c
+++ b/src/map/HPMmap.c
@@ -1,25 +1,15 @@
// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
// See the LICENSE file
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h"
-#include "../common/showmsg.h"
-#include "../common/HPM.h"
-#include "../common/conf.h"
-#include "../common/db.h"
-#include "../common/des.h"
-#include "../common/ers.h"
-#include "../common/mapindex.h"
-#include "../common/mmo.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-
+#define HERCULES_CORE
#include "HPMmap.h"
-#include "pc.h"
-#include "map.h"
-//
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
#include "atcommand.h"
#include "battle.h"
#include "battleground.h"
@@ -37,12 +27,14 @@
#include "itemdb.h"
#include "log.h"
#include "mail.h"
+#include "map.h"
#include "mapreg.h"
#include "mercenary.h"
#include "mob.h"
#include "npc.h"
#include "party.h"
#include "path.h"
+#include "pc.h"
#include "pc_groups.h"
#include "pet.h"
#include "quest.h"
@@ -54,11 +46,19 @@
#include "trade.h"
#include "unit.h"
#include "vending.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
+#include "../common/HPM.h"
+#include "../common/cbasetypes.h"
+#include "../common/conf.h"
+#include "../common/db.h"
+#include "../common/des.h"
+#include "../common/ers.h"
+#include "../common/malloc.h"
+#include "../common/mapindex.h"
+#include "../common/mmo.h"
+#include "../common/showmsg.h"
+#include "../common/socket.h"
+#include "../common/strlib.h"
+#include "../common/sysinfo.h"
#include "../common/HPMDataCheck.h"
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 5fd0faf86..df3be40a5 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -2,57 +2,60 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/mmo.h"
-#include "../common/timer.h"
-#include "../common/nullpo.h"
-#include "../common/core.h"
-#include "../common/showmsg.h"
-#include "../common/malloc.h"
-#include "../common/random.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/utils.h"
-#include "../common/conf.h"
-#include "../common/sysinfo.h"
+#define HERCULES_CORE
+#include "../config/core.h" // AUTOLOOTITEM_SIZE, AUTOTRADE_PERSISTENCY, MAX_CARTS, MAX_SUGGESTIONS, MOB_FLEE(), MOB_HIT(), RENEWAL, RENEWAL_DROP, RENEWAL_EXP
#include "atcommand.h"
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
#include "battle.h"
#include "chat.h"
-#include "clif.h"
#include "chrif.h"
+#include "clif.h"
#include "duel.h"
+#include "elemental.h"
+#include "guild.h"
+#include "homunculus.h"
#include "intif.h"
#include "itemdb.h"
#include "log.h"
+#include "mail.h"
#include "map.h"
-#include "pc.h"
-#include "pc_groups.h" // groupid2name
-#include "status.h"
-#include "skill.h"
+#include "mapreg.h"
+#include "mercenary.h"
#include "mob.h"
#include "npc.h"
-#include "pet.h"
-#include "homunculus.h"
-#include "mail.h"
-#include "mercenary.h"
-#include "elemental.h"
#include "party.h"
-#include "guild.h"
+#include "pc.h"
+#include "pc_groups.h" // groupid2name
+#include "pet.h"
+#include "quest.h"
#include "script.h"
+#include "searchstore.h"
+#include "skill.h"
+#include "status.h"
#include "storage.h"
#include "trade.h"
#include "unit.h"
-#include "mapreg.h"
-#include "quest.h"
-#include "searchstore.h"
+#include "../common/cbasetypes.h"
+#include "../common/conf.h"
+#include "../common/core.h"
+#include "../common/malloc.h"
+#include "../common/mmo.h"
+#include "../common/nullpo.h"
+#include "../common/random.h"
+#include "../common/showmsg.h"
+#include "../common/socket.h"
+#include "../common/strlib.h"
+#include "../common/sysinfo.h"
+#include "../common/timer.h"
+#include "../common/utils.h"
#include "HPMmap.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
struct atcommand_interface atcommand_s;
static char atcmd_output[CHAT_SIZE_MAX];
diff --git a/src/map/atcommand.h b/src/map/atcommand.h
index bc4ab30a3..c8a1863af 100644
--- a/src/map/atcommand.h
+++ b/src/map/atcommand.h
@@ -5,9 +5,9 @@
#ifndef _MAP_ATCOMMAND_H_
#define _MAP_ATCOMMAND_H_
+#include "pc_groups.h"
#include "../common/conf.h"
#include "../common/db.h"
-#include "pc_groups.h"
/**
* Declarations
diff --git a/src/map/battle.c b/src/map/battle.c
index 9089b7102..0865ee4ba 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -2,41 +2,44 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/timer.h"
-#include "../common/nullpo.h"
-#include "../common/malloc.h"
-#include "../common/showmsg.h"
-#include "../common/ers.h"
-#include "../common/random.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/utils.h"
-#include "../common/sysinfo.h"
-#include "../common/HPM.h"
+#define HERCULES_CORE
-#include "map.h"
-#include "path.h"
-#include "pc.h"
-#include "status.h"
-#include "skill.h"
-#include "homunculus.h"
-#include "mercenary.h"
-#include "elemental.h"
-#include "mob.h"
-#include "itemdb.h"
-#include "clif.h"
-#include "pet.h"
-#include "guild.h"
-#include "party.h"
+#include "../config/core.h" // CELL_NOSTACK, CIRCULAR_AREA, CONSOLE_INPUT, HMAP_ZONE_DAMAGE_CAP_TYPE, OFFICIAL_WALKPATH, RENEWAL, RENEWAL_ASPD, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EDP, RENEWAL_EXP, RENEWAL_LVDMG, RE_LVL_DMOD(), RE_LVL_MDMOD(), RE_LVL_TMDMOD(), RE_SKILL_REDUCTION(), SCRIPT_CALLFUNC_CHECK, SECURE_NPCTIMEOUT, STATS_OPT_OUT
#include "battle.h"
-#include "battleground.h"
-#include "chrif.h"
+#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <math.h>
+
+#include "battleground.h"
+#include "chrif.h"
+#include "clif.h"
+#include "elemental.h"
+#include "guild.h"
+#include "homunculus.h"
+#include "itemdb.h"
+#include "map.h"
+#include "mercenary.h"
+#include "mob.h"
+#include "party.h"
+#include "path.h"
+#include "pc.h"
+#include "pet.h"
+#include "skill.h"
+#include "status.h"
+#include "../common/HPM.h"
+#include "../common/cbasetypes.h"
+#include "../common/ers.h"
+#include "../common/malloc.h"
+#include "../common/nullpo.h"
+#include "../common/random.h"
+#include "../common/showmsg.h"
+#include "../common/socket.h"
+#include "../common/strlib.h"
+#include "../common/sysinfo.h"
+#include "../common/timer.h"
+#include "../common/utils.h"
struct Battle_Config battle_config;
struct battle_interface battle_s;
diff --git a/src/map/battle.h b/src/map/battle.h
index 88038ddb4..fbe097c78 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -5,8 +5,8 @@
#ifndef _MAP_BATTLE_H_
#define _MAP_BATTLE_H_
-#include "../common/cbasetypes.h"
#include "map.h" //ELE_MAX
+#include "../common/cbasetypes.h"
/**
* Declarations
diff --git a/src/map/battleground.c b/src/map/battleground.c
index 68539e25d..a7169de0e 100644
--- a/src/map/battleground.c
+++ b/src/map/battleground.c
@@ -2,29 +2,32 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/timer.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/conf.h"
+#define HERCULES_CORE
#include "battleground.h"
+
+#include <string.h>
+#include <stdio.h>
+
#include "battle.h"
#include "clif.h"
+#include "homunculus.h"
#include "map.h"
+#include "mapreg.h"
+#include "mercenary.h"
+#include "mob.h" // struct mob_data
#include "npc.h"
-#include "pc.h"
#include "party.h"
+#include "pc.h"
#include "pet.h"
-#include "homunculus.h"
-#include "mercenary.h"
-#include "mapreg.h"
-
-#include <string.h>
-#include <stdio.h>
+#include "../common/cbasetypes.h"
+#include "../common/conf.h"
+#include "../common/malloc.h"
+#include "../common/nullpo.h"
+#include "../common/showmsg.h"
+#include "../common/socket.h"
+#include "../common/strlib.h"
+#include "../common/timer.h"
struct battleground_interface bg_s;
diff --git a/src/map/battleground.h b/src/map/battleground.h
index 05c4eb060..ec0a86f14 100644
--- a/src/map/battleground.h
+++ b/src/map/battleground.h
@@ -5,9 +5,9 @@
#ifndef _MAP_BATTLEGROUND_H_
#define _MAP_BATTLEGROUND_H_
-#include "../common/mmo.h" // struct party
#include "clif.h"
#include "guild.h"
+#include "../common/mmo.h" // struct party
/**
* Defines
diff --git a/src/map/buyingstore.c b/src/map/buyingstore.c
index 2a15e66fc..80264b30d 100644
--- a/src/map/buyingstore.c
+++ b/src/map/buyingstore.c
@@ -2,18 +2,21 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/db.h" // ARR_FIND
-#include "../common/showmsg.h" // ShowWarning
-#include "../common/socket.h" // RBUF*
-#include "../common/strlib.h" // safestrncpy
+#define HERCULES_CORE
+
+#include "buyingstore.h" // struct s_buyingstore
+
#include "atcommand.h" // msg_txt
#include "battle.h" // battle_config.*
-#include "buyingstore.h" // struct s_buyingstore
+#include "chrif.h"
#include "clif.h" // clif->buyingstore_*
#include "log.h" // log_pick_pc, log_zeny
#include "pc.h" // struct map_session_data
-#include "chrif.h"
+#include "../common/cbasetypes.h"
+#include "../common/db.h" // ARR_FIND
+#include "../common/showmsg.h" // ShowWarning
+#include "../common/socket.h" // RBUF*
+#include "../common/strlib.h" // safestrncpy
struct buyingstore_interface buyingstore_s;
diff --git a/src/map/buyingstore.h b/src/map/buyingstore.h
index 5141a1013..914631872 100644
--- a/src/map/buyingstore.h
+++ b/src/map/buyingstore.h
@@ -5,6 +5,11 @@
#ifndef _MAP_BUYINGSTORE_H_
#define _MAP_BUYINGSTORE_H_
+#include "../common/cbasetypes.h"
+#include "../common/mmo.h" // MAX_SLOTS
+
+struct map_session_data;
+
/**
* Declarations
**/
diff --git a/src/map/chat.c b/src/map/chat.c
index 08fc4a575..c9d3e6d46 100644
--- a/src/map/chat.c
+++ b/src/map/chat.c
@@ -2,12 +2,13 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/mmo.h"
+#define HERCULES_CORE
+
+#include "chat.h"
+
+#include <stdio.h>
+#include <string.h>
+
#include "atcommand.h" // msg_txt()
#include "battle.h" // struct battle_config
#include "clif.h"
@@ -15,10 +16,12 @@
#include "npc.h" // npc_event_do()
#include "pc.h"
#include "skill.h" // ext_skill_unit_onplace()
-#include "chat.h"
-
-#include <stdio.h>
-#include <string.h>
+#include "../common/cbasetypes.h"
+#include "../common/malloc.h"
+#include "../common/mmo.h"
+#include "../common/nullpo.h"
+#include "../common/showmsg.h"
+#include "../common/strlib.h"
struct chat_interface chat_s;
diff --git a/src/map/chat.h b/src/map/chat.h
index b0c6cd905..cbc2a391e 100644
--- a/src/map/chat.h
+++ b/src/map/chat.h
@@ -6,9 +6,12 @@
#define _MAP_CHAT_H_
#include "map.h" // struct block_list, CHATROOM_TITLE_SIZE
+#include "../common/cbasetypes.h"
+#include "../common/db.h"
-struct map_session_data;
struct chat_data;
+struct map_session_data;
+struct npc_data;
#define MAX_CHAT_USERS 20
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 99a1935fd..81e2d387c 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -2,15 +2,16 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h"
-#include "../common/socket.h"
-#include "../common/timer.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/ers.h"
-#include "../common/HPM.h"
+#define HERCULES_CORE
+
+#include "../config/core.h" // AUTOTRADE_PERSISTENCY, STATS_OPT_OUT
+#include "chrif.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <time.h>
#include "map.h"
#include "battle.h"
@@ -25,15 +26,17 @@
#include "instance.h"
#include "mercenary.h"
#include "elemental.h"
-#include "chrif.h"
#include "quest.h"
#include "storage.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <time.h>
+#include "../common/HPM.h"
+#include "../common/cbasetypes.h"
+#include "../common/ers.h"
+#include "../common/malloc.h"
+#include "../common/nullpo.h"
+#include "../common/showmsg.h"
+#include "../common/socket.h"
+#include "../common/strlib.h"
+#include "../common/timer.h"
struct chrif_interface chrif_s;
diff --git a/src/map/chrif.h b/src/map/chrif.h
index 25e955604..84efc66d3 100644
--- a/src/map/chrif.h
+++ b/src/map/chrif.h
@@ -5,9 +5,11 @@
#ifndef _MAP_CHRIF_H_
#define _MAP_CHRIF_H_
-#include "../common/cbasetypes.h"
#include <time.h>
+
#include "map.h" //TBL_stuff
+#include "../common/cbasetypes.h"
+#include "../common/db.h"
struct status_change_entry;
diff --git a/src/map/clif.c b/src/map/clif.c
index 062a437a2..1da6070e8 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -2,56 +2,59 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/socket.h"
-#include "../common/timer.h"
-#include "../common/grfio.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/utils.h"
-#include "../common/ers.h"
-#include "../common/conf.h"
-#include "../common/HPM.h"
+#define HERCULES_CORE
+
+#include "../config/core.h" // ANTI_MAYAP_CHEAT, NEW_CARTS, RENEWAL, SECURE_NPCTIMEOUT
+#include "clif.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+#include <time.h>
-#include "map.h"
-#include "chrif.h"
-#include "pc.h"
-#include "status.h"
-#include "npc.h"
-#include "itemdb.h"
-#include "chat.h"
-#include "trade.h"
-#include "storage.h"
-#include "script.h"
-#include "skill.h"
#include "atcommand.h"
-#include "intif.h"
#include "battle.h"
#include "battleground.h"
-#include "mob.h"
-#include "party.h"
-#include "unit.h"
+#include "chat.h"
+#include "chrif.h"
+#include "elemental.h"
#include "guild.h"
-#include "vending.h"
-#include "pet.h"
#include "homunculus.h"
#include "instance.h"
-#include "mercenary.h"
-#include "elemental.h"
+#include "intif.h"
+#include "irc-bot.h"
+#include "itemdb.h"
#include "log.h"
-#include "clif.h"
#include "mail.h"
+#include "map.h"
+#include "mercenary.h"
+#include "mob.h"
+#include "npc.h"
+#include "party.h"
+#include "pc.h"
+#include "pet.h"
#include "quest.h"
-#include "irc-bot.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-#include <time.h>
+#include "script.h"
+#include "skill.h"
+#include "status.h"
+#include "storage.h"
+#include "trade.h"
+#include "unit.h"
+#include "vending.h"
+#include "../common/HPM.h"
+#include "../common/cbasetypes.h"
+#include "../common/conf.h"
+#include "../common/ers.h"
+#include "../common/grfio.h"
+#include "../common/malloc.h"
+#include "../common/nullpo.h"
+#include "../common/random.h"
+#include "../common/showmsg.h"
+#include "../common/socket.h"
+#include "../common/strlib.h"
+#include "../common/timer.h"
+#include "../common/utils.h"
struct clif_interface clif_s;
diff --git a/src/map/clif.h b/src/map/clif.h
index bbe07b718..f54c4afce 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -5,13 +5,13 @@
#ifndef _MAP_CLIF_H_
#define _MAP_CLIF_H_
+#include <stdarg.h>
+
+#include "map.h"
+#include "packets_struct.h"
#include "../common/cbasetypes.h"
#include "../common/db.h"
#include "../common/mmo.h"
-#include "../common/socket.h"
-#include "../map/map.h"
-#include "../map/packets_struct.h"
-#include <stdarg.h>
/**
* Declarations
@@ -20,7 +20,6 @@ struct item;
struct item_data;
struct storage_data;
struct guild_storage;
-struct block_list;
struct unit_data;
struct map_session_data;
struct homun_data;
diff --git a/src/map/date.c b/src/map/date.c
index f38ead858..975a00c50 100644
--- a/src/map/date.c
+++ b/src/map/date.c
@@ -1,10 +1,14 @@
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
-#include "../common/cbasetypes.h"
+#define HERCULES_CORE
+
#include "date.h"
+
#include <time.h>
+#include "../common/cbasetypes.h"
+
int date_get_year(void)
{
time_t t;
diff --git a/src/map/date.h b/src/map/date.h
index 46f0d86c3..b3ed59b2f 100644
--- a/src/map/date.h
+++ b/src/map/date.h
@@ -4,6 +4,8 @@
#ifndef _MAP_DATE_H_
#define _MAP_DATE_H_
+#include "../common/cbasetypes.h"
+
int date_get_year(void);
int date_get_month(void);
int date_get_day(void);
diff --git a/src/map/duel.c b/src/map/duel.c
index af2741f77..a423ef240 100644
--- a/src/map/duel.c
+++ b/src/map/duel.c
@@ -2,18 +2,20 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
+#define HERCULES_CORE
-#include "atcommand.h" // msg_txt
-#include "clif.h"
#include "duel.h"
-#include "pc.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
+#include "atcommand.h" // msg_txt
+#include "clif.h"
+#include "pc.h"
+#include "../common/cbasetypes.h"
+
/*==========================================
* Duel organizing functions [LuzZza]
*------------------------------------------*/
diff --git a/src/map/duel.h b/src/map/duel.h
index 5405d2eee..956aed36d 100644
--- a/src/map/duel.h
+++ b/src/map/duel.h
@@ -5,6 +5,10 @@
#ifndef _MAP_DUEL_H_
#define _MAP_DUEL_H_
+#include "../common/cbasetypes.h"
+
+struct map_session_data;
+
struct duel {
int members_count;
int invites_count;
diff --git a/src/map/elemental.c b/src/map/elemental.c
index f335600d6..323df41e1 100644
--- a/src/map/elemental.c
+++ b/src/map/elemental.c
@@ -2,42 +2,44 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h"
-#include "../common/socket.h"
-#include "../common/timer.h"
-#include "../common/nullpo.h"
-#include "../common/mmo.h"
-#include "../common/showmsg.h"
-#include "../common/utils.h"
-#include "../common/random.h"
-#include "../common/strlib.h"
+#define HERCULES_CORE
-#include "log.h"
-#include "clif.h"
+#include "elemental.h"
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "atcommand.h"
+#include "battle.h"
#include "chrif.h"
+#include "clif.h"
+#include "guild.h"
#include "intif.h"
#include "itemdb.h"
+#include "log.h"
#include "map.h"
-#include "pc.h"
-#include "status.h"
-#include "skill.h"
#include "mob.h"
-#include "pet.h"
-#include "battle.h"
+#include "npc.h"
#include "party.h"
-#include "guild.h"
-#include "atcommand.h"
+#include "pc.h"
+#include "pet.h"
#include "script.h"
-#include "npc.h"
+#include "skill.h"
+#include "status.h"
#include "trade.h"
#include "unit.h"
-#include "elemental.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
+#include "../common/cbasetypes.h"
+#include "../common/malloc.h"
+#include "../common/mmo.h"
+#include "../common/nullpo.h"
+#include "../common/random.h"
+#include "../common/showmsg.h"
+#include "../common/socket.h"
+#include "../common/strlib.h"
+#include "../common/timer.h"
+#include "../common/utils.h"
struct elemental_interface elemental_s;
diff --git a/src/map/elemental.h b/src/map/elemental.h
index 6d04a41a5..aa27aadc9 100644
--- a/src/map/elemental.h
+++ b/src/map/elemental.h
@@ -7,6 +7,7 @@
#include "status.h" // struct status_data, struct status_change
#include "unit.h" // struct unit_data
+#include "../common/mmo.h" // NAME_LENGTH
/**
* Defines
diff --git a/src/map/guild.c b/src/map/guild.c
index fa5805c8b..69f67238d 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -2,35 +2,38 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/timer.h"
-#include "../common/nullpo.h"
-#include "../common/malloc.h"
-#include "../common/mapindex.h"
-#include "../common/showmsg.h"
-#include "../common/ers.h"
-#include "../common/strlib.h"
-#include "../common/utils.h"
-#include "../common/HPM.h"
+#define HERCULES_CORE
-#include "map.h"
+#include "../config/core.h" // GP_BOUND_ITEMS
#include "guild.h"
-#include "storage.h"
-#include "battle.h"
-#include "npc.h"
-#include "pc.h"
-#include "status.h"
-#include "mob.h"
-#include "intif.h"
-#include "clif.h"
-#include "skill.h"
-#include "log.h"
-#include "instance.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "battle.h"
+#include "clif.h"
+#include "instance.h"
+#include "intif.h"
+#include "log.h"
+#include "map.h"
+#include "mob.h"
+#include "npc.h"
+#include "pc.h"
+#include "skill.h"
+#include "status.h"
+#include "storage.h"
+#include "../common/HPM.h"
+#include "../common/cbasetypes.h"
+#include "../common/ers.h"
+#include "../common/malloc.h"
+#include "../common/mapindex.h"
+#include "../common/nullpo.h"
+#include "../common/showmsg.h"
+#include "../common/strlib.h"
+#include "../common/timer.h"
+#include "../common/utils.h"
+
struct guild_interface guild_s;
/*==========================================
diff --git a/src/map/guild.h b/src/map/guild.h
index b03bd664d..34e27a56c 100644
--- a/src/map/guild.h
+++ b/src/map/guild.h
@@ -5,18 +5,10 @@
#ifndef _MAP_GUILD_H_
#define _MAP_GUILD_H_
-//#include "../common/mmo.h"
-#include "map.h" // NAME_LENGTH
-
-/**
- * Declarations
- **/
-struct guild;
-struct guild_member;
-struct guild_position;
-struct guild_castle;
-struct map_session_data;
-struct mob_data;
+#include "map.h" // EVENT_NAME_LENGTH, TBL_PC
+#include "../common/cbasetypes.h"
+#include "../common/db.h"
+#include "../common/mmo.h"
/**
* Defines
diff --git a/src/map/homunculus.c b/src/map/homunculus.c
index ff9f7a5b1..b6a83d1cb 100644
--- a/src/map/homunculus.c
+++ b/src/map/homunculus.c
@@ -2,43 +2,45 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h"
-#include "../common/socket.h"
-#include "../common/timer.h"
-#include "../common/nullpo.h"
-#include "../common/mmo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/utils.h"
+#define HERCULES_CORE
-#include "log.h"
-#include "clif.h"
+#include "../config/core.h" // DBPATH
+#include "homunculus.h"
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "atcommand.h"
+#include "battle.h"
#include "chrif.h"
+#include "clif.h"
+#include "guild.h"
#include "intif.h"
#include "itemdb.h"
+#include "log.h"
#include "map.h"
-#include "pc.h"
-#include "status.h"
-#include "skill.h"
#include "mob.h"
-#include "pet.h"
-#include "battle.h"
+#include "npc.h"
#include "party.h"
-#include "guild.h"
-#include "atcommand.h"
+#include "pc.h"
+#include "pet.h"
#include "script.h"
-#include "npc.h"
+#include "skill.h"
+#include "status.h"
#include "trade.h"
#include "unit.h"
-
-#include "homunculus.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
+#include "../common/cbasetypes.h"
+#include "../common/malloc.h"
+#include "../common/mmo.h"
+#include "../common/nullpo.h"
+#include "../common/random.h"
+#include "../common/showmsg.h"
+#include "../common/socket.h"
+#include "../common/strlib.h"
+#include "../common/timer.h"
+#include "../common/utils.h"
struct homunculus_interface homunculus_s;
diff --git a/src/map/homunculus.h b/src/map/homunculus.h
index e6d59e30e..9eef6af5b 100644
--- a/src/map/homunculus.h
+++ b/src/map/homunculus.h
@@ -5,9 +5,10 @@
#ifndef _MAP_HOMUNCULUS_H_
#define _MAP_HOMUNCULUS_H_
+#include "pc.h"
#include "status.h" // struct status_data, struct status_change
#include "unit.h" // struct unit_data
-#include "pc.h"
+#include "../common/mmo.h"
#define MAX_HOM_SKILL_REQUIRE 5
#define homdb_checkid(id) ((id) >= HM_CLASS_BASE && (id) <= HM_CLASS_MAX)
diff --git a/src/map/instance.c b/src/map/instance.c
index caf622b3d..5789d7dd6 100644
--- a/src/map/instance.c
+++ b/src/map/instance.c
@@ -2,30 +2,32 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/socket.h"
-#include "../common/timer.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/utils.h"
-#include "../common/db.h"
-#include "../common/HPM.h"
+#define HERCULES_CORE
-#include "clif.h"
#include "instance.h"
-#include "map.h"
-#include "npc.h"
-#include "party.h"
-#include "pc.h"
+#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <stdarg.h>
#include <time.h>
+#include "clif.h"
+#include "map.h"
+#include "npc.h"
+#include "party.h"
+#include "pc.h"
+#include "../common/HPM.h"
+#include "../common/cbasetypes.h"
+#include "../common/db.h"
+#include "../common/malloc.h"
+#include "../common/nullpo.h"
+#include "../common/showmsg.h"
+#include "../common/socket.h"
+#include "../common/strlib.h"
+#include "../common/timer.h"
+#include "../common/utils.h"
+
struct instance_interface instance_s;
/// Checks whether given instance id is valid or not.
diff --git a/src/map/instance.h b/src/map/instance.h
index 712a0f141..ae649eda7 100644
--- a/src/map/instance.h
+++ b/src/map/instance.h
@@ -6,8 +6,11 @@
#define _MAP_INSTANCE_H_
#include "script.h" // struct reg_db
+#include "../common/cbasetypes.h"
#include "../common/mmo.h" // struct point
+
struct block_list;
+struct map_session_data;
#define INSTANCE_NAME_LENGTH (60+1)
diff --git a/src/map/intif.c b/src/map/intif.c
index 6bd24368a..383150fbc 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -1,37 +1,40 @@
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/timer.h"
-#include "../common/nullpo.h"
-#include "../common/malloc.h"
-#include "../common/strlib.h"
-#include "map.h"
+#define HERCULES_CORE
+
+#include "../config/core.h" // GP_BOUND_ITEMS
+#include "intif.h"
+
+#include <fcntl.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+
+#include "atcommand.h"
#include "battle.h"
#include "chrif.h"
#include "clif.h"
-#include "pc.h"
-#include "intif.h"
-#include "log.h"
-#include "storage.h"
-#include "party.h"
+#include "elemental.h"
#include "guild.h"
-#include "pet.h"
-#include "atcommand.h"
-#include "mercenary.h"
#include "homunculus.h"
-#include "elemental.h"
+#include "log.h"
#include "mail.h"
+#include "map.h"
+#include "mercenary.h"
+#include "party.h"
+#include "pc.h"
+#include "pet.h"
#include "quest.h"
-
-#include <sys/types.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <string.h>
-
+#include "storage.h"
+#include "../common/malloc.h"
+#include "../common/nullpo.h"
+#include "../common/showmsg.h"
+#include "../common/socket.h"
+#include "../common/strlib.h"
+#include "../common/timer.h"
struct intif_interface intif_s;
diff --git a/src/map/intif.h b/src/map/intif.h
index 290dcfcdc..b6ee727f3 100644
--- a/src/map/intif.h
+++ b/src/map/intif.h
@@ -5,19 +5,22 @@
#ifndef _MAP_INTIF_H_
#define _MAP_INTIF_H_
+#include "../common/cbasetypes.h"
/**
* Declarations
**/
-struct party_member;
+struct auction_data;
struct guild_member;
struct guild_position;
-struct s_pet;
+struct guild_storage;
+struct mail_message;
+struct map_session_data;
+struct party_member;
+struct s_elemental;
struct s_homunculus;
struct s_mercenary;
-struct s_elemental;
-struct mail_message;
-struct auction_data;
+struct s_pet;
/**
* Defines
diff --git a/src/map/irc-bot.c b/src/map/irc-bot.c
index ff28082e7..6f016697f 100644
--- a/src/map/irc-bot.c
+++ b/src/map/irc-bot.c
@@ -2,23 +2,25 @@
// See the LICENSE file
// Base Author: shennetsind @ http://hercules.ws
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h"
-#include "../common/strlib.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/timer.h"
-#include "../common/random.h"
+#define HERCULES_CORE
-#include "map.h"
-#include "pc.h"
-#include "clif.h"
#include "irc-bot.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "clif.h"
+#include "map.h"
+#include "pc.h"
+#include "../common/cbasetypes.h"
+#include "../common/malloc.h"
+#include "../common/random.h"
+#include "../common/showmsg.h"
+#include "../common/socket.h"
+#include "../common/strlib.h"
+#include "../common/timer.h"
+
//#define IRCBOT_DEBUG
struct irc_bot_interface irc_bot_s;
diff --git a/src/map/irc-bot.h b/src/map/irc-bot.h
index c15a5d46a..60f03fca5 100644
--- a/src/map/irc-bot.h
+++ b/src/map/irc-bot.h
@@ -6,6 +6,8 @@
#ifndef _MAP_IRC_BOT_H_
#define _MAP_IRC_BOT_H_
+#include "../common/cbasetypes.h"
+
#define IRC_NICK_LENGTH 40
#define IRC_IDENT_LENGTH 40
#define IRC_HOST_LENGTH 63
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 5eeb90be5..1981f435c 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -2,23 +2,28 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/nullpo.h"
-#include "../common/malloc.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/utils.h"
-#include "../common/conf.h"
+#define HERCULES_CORE
+
+#include "../config/core.h" // DBPATH, RENEWAL
#include "itemdb.h"
-#include "map.h"
-#include "battle.h" // struct battle_config
-#include "script.h" // item script processing
-#include "pc.h" // W_MUSICAL, W_WHIP
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "battle.h" // struct battle_config
+#include "map.h"
+#include "mob.h" // MAX_MOB_DB
+#include "pc.h" // W_MUSICAL, W_WHIP
+#include "script.h" // item script processing
+#include "../common/conf.h"
+#include "../common/malloc.h"
+#include "../common/nullpo.h"
+#include "../common/random.h"
+#include "../common/showmsg.h"
+#include "../common/strlib.h"
+#include "../common/utils.h"
+
struct itemdb_interface itemdb_s;
/**
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index 77fb2e2ec..12766b288 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -5,9 +5,12 @@
#ifndef _MAP_ITEMDB_H_
#define _MAP_ITEMDB_H_
+#include "map.h"
+#include "../common/cbasetypes.h"
+#include "../common/conf.h"
#include "../common/db.h"
#include "../common/mmo.h" // ITEM_NAME_LENGTH
-#include "map.h"
+#include "../common/sql.h"
/**
* Declarations
diff --git a/src/map/log.c b/src/map/log.c
index 19a98f34b..523ef1d65 100644
--- a/src/map/log.c
+++ b/src/map/log.c
@@ -2,22 +2,25 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/sql.h" // SQL_INNODB
-#include "../common/strlib.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "battle.h"
-#include "itemdb.h"
+#define HERCULES_CORE
+
#include "log.h"
-#include "map.h"
-#include "mob.h"
-#include "pc.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "battle.h"
+#include "itemdb.h"
+#include "map.h"
+#include "mob.h"
+#include "pc.h"
+#include "../common/cbasetypes.h"
+#include "../common/nullpo.h"
+#include "../common/showmsg.h"
+#include "../common/sql.h" // SQL_INNODB
+#include "../common/strlib.h"
+
struct log_interface log_s;
/// obtain log type character for item/zeny logs
diff --git a/src/map/log.h b/src/map/log.h
index b2cb92c20..ecfedeac2 100644
--- a/src/map/log.h
+++ b/src/map/log.h
@@ -11,11 +11,10 @@
/**
* Declarations
**/
-struct block_list;
-struct map_session_data;
-struct mob_data;
struct item;
struct item_data;
+struct map_session_data;
+struct mob_data;
/**
* Defines
diff --git a/src/map/mail.c b/src/map/mail.c
index 371aa892f..7ba7d7470 100644
--- a/src/map/mail.c
+++ b/src/map/mail.c
@@ -2,19 +2,21 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
+#define HERCULES_CORE
#include "mail.h"
-#include "atcommand.h"
-#include "itemdb.h"
-#include "clif.h"
-#include "pc.h"
-#include "log.h"
#include <time.h>
#include <string.h>
+#include "atcommand.h"
+#include "clif.h"
+#include "itemdb.h"
+#include "log.h"
+#include "pc.h"
+#include "../common/nullpo.h"
+#include "../common/showmsg.h"
+
struct mail_interface mail_s;
void mail_clear(struct map_session_data *sd)
diff --git a/src/map/mail.h b/src/map/mail.h
index 8df537ff3..30b032ef4 100644
--- a/src/map/mail.h
+++ b/src/map/mail.h
@@ -5,7 +5,11 @@
#ifndef _MAP_MAIL_H_
#define _MAP_MAIL_H_
-#include "../common/mmo.h"
+#include "../common/cbasetypes.h"
+
+struct item;
+struct mail_message;
+struct map_session_data;
struct mail_interface {
void (*clear) (struct map_session_data *sd);
diff --git a/src/map/map.c b/src/map/map.c
index 24a07699f..bccb51d7e 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -2,62 +2,66 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/core.h"
-#include "../common/timer.h"
-#include "../common/ers.h"
-#include "../common/grfio.h"
-#include "../common/malloc.h"
-#include "../common/socket.h" // WFIFO*()
-#include "../common/showmsg.h"
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/strlib.h"
-#include "../common/utils.h"
-#include "../common/conf.h"
-#include "../common/console.h"
-#include "../common/HPM.h"
+#define HERCULES_CORE
+#include "../config/core.h" // CELL_NOSTACK, CIRCULAR_AREA, CONSOLE_INPUT, DBPATH, RENEWAL
#include "map.h"
-#include "path.h"
+
+#include <math.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "HPMmap.h"
+#include "atcommand.h"
+#include "battle.h"
+#include "battleground.h"
+#include "chat.h"
#include "chrif.h"
#include "clif.h"
#include "duel.h"
+#include "elemental.h"
+#include "guild.h"
+#include "homunculus.h"
+#include "instance.h"
#include "intif.h"
+#include "irc-bot.h"
+#include "itemdb.h"
+#include "log.h"
+#include "mail.h"
+#include "mapreg.h"
+#include "mercenary.h"
+#include "mob.h"
#include "npc.h"
+#include "npc.h" // npc_setcells(), npc_unsetcells()
+#include "party.h"
+#include "path.h"
#include "pc.h"
+#include "pet.h"
+#include "quest.h"
+#include "script.h"
+#include "skill.h"
#include "status.h"
-#include "mob.h"
-#include "npc.h" // npc_setcells(), npc_unsetcells()
-#include "chat.h"
-#include "itemdb.h"
#include "storage.h"
-#include "skill.h"
#include "trade.h"
-#include "party.h"
#include "unit.h"
-#include "battle.h"
-#include "battleground.h"
-#include "quest.h"
-#include "script.h"
-#include "mapreg.h"
-#include "guild.h"
-#include "pet.h"
-#include "homunculus.h"
-#include "instance.h"
-#include "mercenary.h"
-#include "elemental.h"
-#include "atcommand.h"
-#include "log.h"
-#include "mail.h"
-#include "irc-bot.h"
-#include "HPMmap.h"
+#include "../common/HPM.h"
+#include "../common/cbasetypes.h"
+#include "../common/conf.h"
+#include "../common/console.h"
+#include "../common/core.h"
+#include "../common/ers.h"
+#include "../common/grfio.h"
+#include "../common/malloc.h"
+#include "../common/nullpo.h"
+#include "../common/random.h"
+#include "../common/showmsg.h"
+#include "../common/socket.h" // WFIFO*()
+#include "../common/strlib.h"
+#include "../common/timer.h"
+#include "../common/utils.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-#include <math.h>
#ifndef _WIN32
#include <unistd.h>
#endif
@@ -5480,8 +5484,8 @@ void map_cp_defaults(void) {
map->cpsd->bl.y = MAP_DEFAULT_Y;
map->cpsd->bl.m = map->mapname2mapid(MAP_DEFAULT);
- console->addCommand("gm:info",CPCMD_A(gm_position));
- console->addCommand("gm:use",CPCMD_A(gm_use));
+ console->input->addCommand("gm:info",CPCMD_A(gm_position));
+ console->input->addCommand("gm:use",CPCMD_A(gm_use));
#endif
}
/* Hercules Plugin Mananger */
@@ -5837,7 +5841,7 @@ int do_init(int argc, char *argv[])
Sql_HerculesUpdateCheck(map->mysql_handle);
#ifdef CONSOLE_INPUT
- console->setSQL(map->mysql_handle);
+ console->input->setSQL(map->mysql_handle);
#endif
ShowStatus("Server is '"CL_GREEN"ready"CL_RESET"' and listening on port '"CL_WHITE"%d"CL_RESET"'.\n\n", map->port);
diff --git a/src/map/map.h b/src/map/map.h
index 6b2e9d909..8277c7a62 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -5,18 +5,18 @@
#ifndef _MAP_MAP_H_
#define _MAP_MAP_H_
+#include <stdarg.h>
+
+#include "atcommand.h"
#include "../common/cbasetypes.h"
#include "../common/core.h" // CORE_ST_LAST
#include "../common/mmo.h"
#include "../common/mapindex.h"
#include "../common/db.h"
-#include "../config/core.h"
#include "../common/sql.h"
-#include "atcommand.h"
-#include <stdarg.h>
+struct mob_data;
struct npc_data;
-struct item_data;
struct hChSysCh;
enum E_MAPSERVER_ST {
@@ -36,7 +36,6 @@ enum E_MAPSERVER_ST {
#define NATURAL_HEAL_INTERVAL 500
#define MIN_FLOORITEM 2
#define MAX_FLOORITEM START_ACCOUNT_NUM
-#define MAX_LEVEL 175
#define MAX_IGNORE_LIST 20 // official is 14
#define MAX_VENDING 12
#define MAX_MAP_SIZE (512*512) // Wasn't there something like this already? Can't find it.. [Shinryo]
diff --git a/src/map/mapreg_sql.c b/src/map/mapreg_sql.c
index 61c25f24e..f026fde00 100644
--- a/src/map/mapreg_sql.c
+++ b/src/map/mapreg_sql.c
@@ -2,6 +2,15 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
+#define HERCULES_CORE
+
+#include "mapreg.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "map.h" // map->mysql_handle
+#include "script.h"
#include "../common/cbasetypes.h"
#include "../common/db.h"
#include "../common/ers.h"
@@ -10,11 +19,6 @@
#include "../common/sql.h"
#include "../common/strlib.h"
#include "../common/timer.h"
-#include "map.h" // map->mysql_handle
-#include "script.h"
-#include "mapreg.h"
-#include <stdlib.h>
-#include <string.h>
struct mapreg_interface mapreg_s;
diff --git a/src/map/mercenary.c b/src/map/mercenary.c
index 495621014..26bc8c188 100644
--- a/src/map/mercenary.c
+++ b/src/map/mercenary.c
@@ -2,42 +2,44 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h"
-#include "../common/socket.h"
-#include "../common/timer.h"
-#include "../common/nullpo.h"
-#include "../common/mmo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/utils.h"
+#define HERCULES_CORE
-#include "log.h"
-#include "clif.h"
+#include "mercenary.h"
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "atcommand.h"
+#include "battle.h"
#include "chrif.h"
+#include "clif.h"
+#include "guild.h"
#include "intif.h"
#include "itemdb.h"
+#include "log.h"
#include "map.h"
-#include "pc.h"
-#include "status.h"
-#include "skill.h"
#include "mob.h"
-#include "pet.h"
-#include "battle.h"
+#include "npc.h"
#include "party.h"
-#include "guild.h"
-#include "atcommand.h"
+#include "pc.h"
+#include "pet.h"
#include "script.h"
-#include "npc.h"
+#include "skill.h"
+#include "status.h"
#include "trade.h"
#include "unit.h"
-#include "mercenary.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
+#include "../common/cbasetypes.h"
+#include "../common/malloc.h"
+#include "../common/mmo.h"
+#include "../common/nullpo.h"
+#include "../common/random.h"
+#include "../common/showmsg.h"
+#include "../common/socket.h"
+#include "../common/strlib.h"
+#include "../common/timer.h"
+#include "../common/utils.h"
struct mercenary_interface mercenary_s;
diff --git a/src/map/mercenary.h b/src/map/mercenary.h
index dd9266b2e..b998ac006 100644
--- a/src/map/mercenary.h
+++ b/src/map/mercenary.h
@@ -6,6 +6,7 @@
#include "status.h" // struct status_data, struct status_change
#include "unit.h" // struct unit_data
+#include "../common/cbasetypes.h"
// number of cells that a mercenary can walk to from it's master before being warped
#define MAX_MER_DISTANCE 15
diff --git a/src/map/mob.c b/src/map/mob.c
index 8f12d4b1b..11ac74621 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2,46 +2,49 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/timer.h"
-#include "../common/db.h"
-#include "../common/nullpo.h"
-#include "../common/malloc.h"
-#include "../common/showmsg.h"
-#include "../common/ers.h"
-#include "../common/random.h"
-#include "../common/strlib.h"
-#include "../common/utils.h"
-#include "../common/socket.h"
+#define HERCULES_CORE
-#include "map.h"
-#include "path.h"
-#include "clif.h"
-#include "intif.h"
-#include "pc.h"
-#include "pet.h"
-#include "status.h"
+#include "../config/core.h" // AUTOLOOT_DISTANCE, DBPATH, DEFTYPE_MAX, DEFTYPE_MIN, RENEWAL_DROP, RENEWAL_EXP
#include "mob.h"
-#include "homunculus.h"
-#include "mercenary.h"
+
+#include <math.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "atcommand.h"
+#include "battle.h"
+#include "clif.h"
+#include "date.h"
#include "elemental.h"
#include "guild.h"
+#include "homunculus.h"
+#include "intif.h"
#include "itemdb.h"
-#include "skill.h"
-#include "battle.h"
-#include "party.h"
-#include "npc.h"
#include "log.h"
-#include "script.h"
-#include "atcommand.h"
-#include "date.h"
+#include "map.h"
+#include "mercenary.h"
+#include "npc.h"
+#include "party.h"
+#include "path.h"
+#include "pc.h"
+#include "pet.h"
#include "quest.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <math.h>
+#include "script.h"
+#include "skill.h"
+#include "status.h"
+#include "../common/cbasetypes.h"
+#include "../common/db.h"
+#include "../common/ers.h"
+#include "../common/malloc.h"
+#include "../common/nullpo.h"
+#include "../common/random.h"
+#include "../common/showmsg.h"
+#include "../common/socket.h"
+#include "../common/strlib.h"
+#include "../common/timer.h"
+#include "../common/utils.h"
struct mob_interface mob_s;
diff --git a/src/map/mob.h b/src/map/mob.h
index 80175b1db..d07f78c77 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -5,12 +5,11 @@
#ifndef _MAP_MOB_H_
#define _MAP_MOB_H_
-#include "../common/mmo.h" // struct item
-#include "guild.h" // struct guardian_data
#include "map.h" // struct status_data, struct view_data, struct mob_skill
-#include "status.h" // struct status data, struct status_change
-#include "unit.h" // unit_stop_walking(), unit_stop_attack()
-#include "npc.h"
+#include "status.h" // struct status_data, struct status_change
+#include "unit.h" // struct unit_data
+#include "../common/cbasetypes.h"
+#include "../common/mmo.h" // struct item
#define MAX_RANDOMMONSTER 5
diff --git a/src/map/npc.c b/src/map/npc.c
index 27759d185..289c42d44 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -2,41 +2,44 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/timer.h"
-#include "../common/nullpo.h"
-#include "../common/malloc.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/utils.h"
-#include "../common/ers.h"
-#include "../common/db.h"
-#include "../common/socket.h"
-#include "../common/HPM.h"
+#define HERCULES_CORE
-#include "map.h"
-#include "log.h"
+#include "../config/core.h" // NPC_SECURE_TIMEOUT_INPUT, NPC_SECURE_TIMEOUT_MENU, NPC_SECURE_TIMEOUT_NEXT, SECURE_NPCTIMEOUT, SECURE_NPCTIMEOUT_INTERVAL
+#include "npc.h"
+
+#include <errno.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+#include "battle.h"
+#include "chat.h"
#include "clif.h"
+#include "instance.h"
#include "intif.h"
-#include "pc.h"
-#include "status.h"
#include "itemdb.h"
-#include "script.h"
+#include "log.h"
+#include "map.h"
#include "mob.h"
+#include "pc.h"
#include "pet.h"
-#include "instance.h"
-#include "battle.h"
+#include "script.h"
#include "skill.h"
+#include "status.h"
#include "unit.h"
-#include "npc.h"
-#include "chat.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <time.h>
-#include <errno.h>
+#include "../common/HPM.h"
+#include "../common/cbasetypes.h"
+#include "../common/db.h"
+#include "../common/ers.h"
+#include "../common/malloc.h"
+#include "../common/nullpo.h"
+#include "../common/showmsg.h"
+#include "../common/socket.h"
+#include "../common/strlib.h"
+#include "../common/timer.h"
+#include "../common/utils.h"
struct npc_interface npc_s;
diff --git a/src/map/npc.h b/src/map/npc.h
index d11db0164..a277d4968 100644
--- a/src/map/npc.h
+++ b/src/map/npc.h
@@ -8,10 +8,10 @@
#include "map.h" // struct block_list
#include "status.h" // struct status_change
#include "unit.h" // struct unit_data
+#include "../common/cbasetypes.h"
+#include "../common/db.h"
struct HPluginData;
-struct block_list;
-struct npc_data;
struct view_data;
enum npc_parse_options {
diff --git a/src/map/npc_chat.c b/src/map/npc_chat.c
index 9d5639efc..f245ffea5 100644
--- a/src/map/npc_chat.c
+++ b/src/map/npc_chat.c
@@ -2,25 +2,27 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifdef PCRE_SUPPORT
+#define HERCULES_CORE
-#include "../common/timer.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
+#ifdef PCRE_SUPPORT
-#include "mob.h" // struct mob_data
#include "npc.h" // struct npc_data
-#include "pc.h" // struct map_session_data
-#include "script.h" // set_var()
-
-#include "../../3rdparty/pcre/include/pcre.h"
+#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <stdarg.h>
+
+#include "../../3rdparty/pcre/include/pcre.h"
+
+#include "mob.h" // struct mob_data
+#include "pc.h" // struct map_session_data
+#include "script.h" // set_var()
+#include "../common/malloc.h"
+#include "../common/nullpo.h"
+#include "../common/showmsg.h"
+#include "../common/strlib.h"
+#include "../common/timer.h"
/**
* interface sources
diff --git a/src/map/party.c b/src/map/party.c
index cf5e7bbe3..7c49e241c 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -2,34 +2,37 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/timer.h"
-#include "../common/socket.h" // last_tick
-#include "../common/nullpo.h"
-#include "../common/malloc.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/utils.h"
-#include "../common/strlib.h"
-#include "../common/HPM.h"
+#define HERCULES_CORE
+#include "../config/core.h" // GP_BOUND_ITEMS, RENEWAL_EXP
#include "party.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
#include "atcommand.h" //msg_txt()
-#include "pc.h"
-#include "map.h"
-#include "instance.h"
#include "battle.h"
-#include "intif.h"
#include "clif.h"
+#include "instance.h"
+#include "intif.h"
+#include "itemdb.h"
#include "log.h"
+#include "map.h"
+#include "mob.h" // struct mob_data
+#include "pc.h"
#include "skill.h"
#include "status.h"
-#include "itemdb.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
+#include "../common/HPM.h"
+#include "../common/cbasetypes.h"
+#include "../common/malloc.h"
+#include "../common/nullpo.h"
+#include "../common/random.h"
+#include "../common/showmsg.h"
+#include "../common/socket.h" // last_tick
+#include "../common/strlib.h"
+#include "../common/timer.h"
+#include "../common/utils.h"
struct party_interface party_s;
diff --git a/src/map/party.h b/src/map/party.h
index ed8289af6..3bad22b13 100644
--- a/src/map/party.h
+++ b/src/map/party.h
@@ -5,11 +5,12 @@
#ifndef _MAP_PARTY_H_
#define _MAP_PARTY_H_
-#include "../common/mmo.h" // struct party
-#include "../config/core.h"
#include <stdarg.h>
-#include "map.h"
+#include "map.h" // TBL_PC
+#include "../common/cbasetypes.h"
+#include "../common/db.h"
+#include "../common/mmo.h" // struct party
#define PARTY_BOOKING_JOBS 6
#define PARTY_BOOKING_RESULTS 10
diff --git a/src/map/path.c b/src/map/path.c
index ae9fc389d..d02e9ee4a 100644
--- a/src/map/path.c
+++ b/src/map/path.c
@@ -2,20 +2,23 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
+#define HERCULES_CORE
+#include "../config/core.h" // CELL_NOSTACK, CIRCULAR_AREA
#include "path.h"
-#include "map.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "map.h"
+#include "../common/cbasetypes.h"
+#include "../common/db.h"
+#include "../common/malloc.h"
+#include "../common/nullpo.h"
+#include "../common/random.h"
+#include "../common/showmsg.h"
+
#define SET_OPEN 0
#define SET_CLOSED 1
diff --git a/src/map/path.h b/src/map/path.h
index 0b67a0120..b48ff05fb 100644
--- a/src/map/path.h
+++ b/src/map/path.h
@@ -6,6 +6,7 @@
#define _MAP_PATH_H_
#include "map.h" // enum cell_chk
+#include "../common/cbasetypes.h"
#define MOVE_COST 10
#define MOVE_DIAGONAL_COST 14
diff --git a/src/map/pc.c b/src/map/pc.c
index c8fb14e55..45adfe22a 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -2,21 +2,16 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/core.h" // get_svn_revision()
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h" // session[]
-#include "../common/strlib.h" // safestrncpy()
-#include "../common/timer.h"
-#include "../common/utils.h"
-#include "../common/conf.h"
-#include "../common/mmo.h" //NAME_LENGTH
-#include "../common/sysinfo.h"
+#define HERCULES_CORE
+#include "../config/core.h" // DBPATH, GP_BOUND_ITEMS, MAX_CARTS, MAX_SPIRITBALL, NEW_CARTS, RENEWAL, RENEWAL_ASPD, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EXP, SECURE_NPCTIMEOUT
#include "pc.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
#include "atcommand.h" // get_atcommand_level()
#include "battle.h" // battle_config
#include "battleground.h"
@@ -25,32 +20,40 @@
#include "clif.h"
#include "date.h" // is_day_of_*()
#include "duel.h"
+#include "elemental.h"
+#include "guild.h" // guild->search(), guild_request_info()
+#include "homunculus.h"
+#include "instance.h"
#include "intif.h"
#include "itemdb.h"
#include "log.h"
#include "mail.h"
#include "map.h"
-#include "path.h"
-#include "homunculus.h"
-#include "instance.h"
#include "mercenary.h"
-#include "elemental.h"
+#include "mob.h" // struct mob_data
#include "npc.h" // fake_nd
-#include "pet.h" // pet_unlocktarget()
#include "party.h" // party->search()
-#include "guild.h" // guild->search(), guild_request_info()
+#include "path.h"
+#include "pc_groups.h"
+#include "pet.h" // pet_unlocktarget()
+#include "quest.h"
#include "script.h" // script_config
#include "skill.h"
#include "status.h" // struct status_data
#include "storage.h"
-#include "pc_groups.h"
-#include "quest.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
+#include "../common/cbasetypes.h"
+#include "../common/conf.h"
+#include "../common/core.h" // get_svn_revision()
+#include "../common/malloc.h"
+#include "../common/mmo.h" //NAME_LENGTH
+#include "../common/nullpo.h"
+#include "../common/random.h"
+#include "../common/showmsg.h"
+#include "../common/socket.h" // session[]
+#include "../common/strlib.h" // safestrncpy()
+#include "../common/sysinfo.h"
+#include "../common/timer.h"
+#include "../common/utils.h"
struct pc_interface pc_s;
@@ -10651,9 +10654,7 @@ void pc_defaults(void) {
memset(pc->exp_table, 0, sizeof(pc->exp_table)
+ sizeof(pc->max_level)
+ sizeof(pc->statp)
-#if defined(RENEWAL_DROP) || defined(RENEWAL_EXP)
+ sizeof(pc->level_penalty)
-#endif
+ sizeof(pc->skill_tree)
+ sizeof(pc->smith_fame_list)
+ sizeof(pc->chemist_fame_list)
diff --git a/src/map/pc.h b/src/map/pc.h
index 70df9ca56..c4026a48d 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -5,23 +5,23 @@
#ifndef _MAP_PC_H_
#define _MAP_PC_H_
-#include "../common/mmo.h" // JOB_*, MAX_FAME_LIST, struct fame_list, struct mmo_charstatus
-#include "../common/ers.h"
-#include "../common/timer.h" // INVALID_TIMER
-#include "atcommand.h" // AtCommandType
+#include "../config/core.h" // AUTOLOOTITEM_SIZE, RENEWAL, SECURE_NPCTIMEOUT
+
#include "battle.h" // battle_config
-#include "battleground.h"
+#include "battleground.h" // enum bg_queue_types
#include "buyingstore.h" // struct s_buyingstore
-#include "itemdb.h"
-#include "log.h"
-#include "map.h" // RC_MAX
-#include "mob.h"
-#include "pc_groups.h"
-#include "script.h" // struct script_reg, struct script_regstr
+#include "itemdb.h" // MAX_ITEMDELAYS
+#include "log.h" // struct e_log_pick_type
+#include "map.h" // RC_MAX, ELE_MAX
+#include "pc_groups.h" // GroupSettings
+#include "script.h" // struct reg_db
#include "searchstore.h" // struct s_search_store_info
-#include "status.h" // OPTION_*, struct weapon_atk
-#include "unit.h" // unit_stop_attack(), unit_stop_walking()
+#include "status.h" // enum sc_type, OPTION_*
+#include "unit.h" // struct unit_data, struct view_data
#include "vending.h" // struct s_vending
+#include "../common/cbasetypes.h"
+#include "../common/ers.h" // struct eri
+#include "../common/mmo.h" // JOB_*, MAX_FAME_LIST, struct fame_list, struct mmo_charstatus
/**
* Defines
@@ -742,9 +742,8 @@ struct pc_interface {
unsigned int exp_table[CLASS_COUNT][2][MAX_LEVEL];
unsigned int max_level[CLASS_COUNT][2];
unsigned int statp[MAX_LEVEL+1];
-#if defined(RENEWAL_DROP) || defined(RENEWAL_EXP)
unsigned int level_penalty[3][RC_MAX][MAX_LEVEL*2+1];
-#endif
+
unsigned int equip_pos[EQI_MAX];
/* */
struct skill_tree_entry skill_tree[CLASS_COUNT][MAX_SKILL_TREE];
diff --git a/src/map/pc_groups.c b/src/map/pc_groups.c
index 906462c7e..a917ef409 100644
--- a/src/map/pc_groups.c
+++ b/src/map/pc_groups.c
@@ -2,6 +2,14 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
+#define HERCULES_CORE
+
+#include "pc_groups.h"
+
+#include "atcommand.h" // atcommand->exists(), atcommand->load_groups()
+#include "clif.h" // clif->GM_kick()
+#include "map.h" // mapiterator
+#include "pc.h" // pc->set_group()
#include "../common/cbasetypes.h"
#include "../common/conf.h"
#include "../common/db.h"
@@ -10,12 +18,6 @@
#include "../common/showmsg.h"
#include "../common/strlib.h" // strcmp
-#include "pc_groups.h"
-#include "atcommand.h" // atcommand->exists(), atcommand->load_groups()
-#include "clif.h" // clif->GM_kick()
-#include "map.h" // mapiterator
-#include "pc.h" // pc->set_group()
-
static GroupSettings dummy_group; ///< dummy group used in dummy map sessions @see pc_get_dummy_sd()
struct pc_groups_interface pcg_s;
diff --git a/src/map/pc_groups.h b/src/map/pc_groups.h
index 5c03f999f..7c8cdd82a 100644
--- a/src/map/pc_groups.h
+++ b/src/map/pc_groups.h
@@ -5,6 +5,10 @@
#ifndef _MAP_PC_GROUPS_H_
#define _MAP_PC_GROUPS_H_
+#include "../common/cbasetypes.h"
+#include "../common/conf.h"
+#include "../common/db.h"
+
/// PC permissions
enum e_pc_permission {
PC_PERM_NONE = 0, // #0
diff --git a/src/map/pet.c b/src/map/pet.c
index 993497434..aa2be4473 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -2,37 +2,39 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/db.h"
-#include "../common/timer.h"
-#include "../common/nullpo.h"
-#include "../common/malloc.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/utils.h"
-#include "../common/ers.h"
+#define HERCULES_CORE
-#include "pc.h"
-#include "status.h"
-#include "map.h"
-#include "path.h"
-#include "intif.h"
-#include "clif.h"
-#include "chrif.h"
#include "pet.h"
-#include "itemdb.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "atcommand.h" // msg_txt()
#include "battle.h"
+#include "chrif.h"
+#include "clif.h"
+#include "intif.h"
+#include "itemdb.h"
+#include "log.h"
+#include "map.h"
#include "mob.h"
#include "npc.h"
+#include "path.h"
+#include "pc.h"
#include "script.h"
#include "skill.h"
+#include "status.h"
#include "unit.h"
-#include "atcommand.h" // msg_txt()
-#include "log.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include "../common/db.h"
+#include "../common/ers.h"
+#include "../common/malloc.h"
+#include "../common/nullpo.h"
+#include "../common/random.h"
+#include "../common/showmsg.h"
+#include "../common/strlib.h"
+#include "../common/timer.h"
+#include "../common/utils.h"
struct pet_interface pet_s;
diff --git a/src/map/pet.h b/src/map/pet.h
index 4ec30b3fb..8dde0fac2 100644
--- a/src/map/pet.h
+++ b/src/map/pet.h
@@ -5,8 +5,14 @@
#ifndef _MAP_PET_H_
#define _MAP_PET_H_
-#define MAX_PET_DB 300
-#define MAX_PETLOOT_SIZE 30
+#include "map.h" // struct block_list
+#include "status.h" // enum sc_type
+#include "unit.h" // struct unit_data
+#include "../common/cbasetypes.h"
+#include "../common/mmo.h" // NAME_LENGTH, struct s_pet
+
+#define MAX_PET_DB 300
+#define MAX_PETLOOT_SIZE 30
struct s_pet_db {
short class_;
diff --git a/src/map/quest.c b/src/map/quest.c
index bde276f9d..b76d6bc82 100644
--- a/src/map/quest.c
+++ b/src/map/quest.c
@@ -2,36 +2,37 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/socket.h"
-#include "../common/timer.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/utils.h"
+#define HERCULES_CORE
-#include "map.h"
-#include "pc.h"
-#include "npc.h"
-#include "itemdb.h"
-#include "script.h"
-#include "intif.h"
-#include "battle.h"
-#include "mob.h"
-#include "party.h"
-#include "unit.h"
-#include "log.h"
-#include "clif.h"
#include "quest.h"
-#include "chrif.h"
+#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <stdarg.h>
#include <time.h>
+#include "battle.h"
+#include "chrif.h"
+#include "clif.h"
+#include "intif.h"
+#include "itemdb.h"
+#include "log.h"
+#include "map.h"
+#include "mob.h"
+#include "npc.h"
+#include "party.h"
+#include "pc.h"
+#include "script.h"
+#include "unit.h"
+#include "../common/cbasetypes.h"
+#include "../common/malloc.h"
+#include "../common/nullpo.h"
+#include "../common/showmsg.h"
+#include "../common/socket.h"
+#include "../common/strlib.h"
+#include "../common/timer.h"
+#include "../common/utils.h"
struct quest_interface quest_s;
diff --git a/src/map/quest.h b/src/map/quest.h
index e01e35619..87894d639 100644
--- a/src/map/quest.h
+++ b/src/map/quest.h
@@ -5,6 +5,10 @@
#ifndef _MAP_QUEST_H_
#define _MAP_QUEST_H_
+#include "map.h" // TBL_PC
+#include "../common/cbasetypes.h"
+#include "../common/mmo.h" // MAX_QUEST_OBJECTIVES
+
#define MAX_QUEST_DB (60355+1) // Highest quest ID + 1
struct quest_db {
diff --git a/src/map/script.c b/src/map/script.c
index aecdf9b28..e4cf7f227 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -2,6 +2,46 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
+#define HERCULES_CORE
+
+#include "../config/core.h" // NEW_CARTS, RENEWAL, RENEWAL_ASPD, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EDP, RENEWAL_EXP, RENEWAL_LVDMG, SCRIPT_CALLFUNC_CHECK, SECURE_NPCTIMEOUT, SECURE_NPCTIMEOUT_INTERVAL
+#include "script.h"
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "atcommand.h"
+#include "battle.h"
+#include "battleground.h"
+#include "chat.h"
+#include "chrif.h"
+#include "clif.h"
+#include "elemental.h"
+#include "guild.h"
+#include "homunculus.h"
+#include "instance.h"
+#include "intif.h"
+#include "itemdb.h"
+#include "log.h"
+#include "mail.h"
+#include "map.h"
+#include "mapreg.h"
+#include "mercenary.h"
+#include "mob.h"
+#include "npc.h"
+#include "party.h"
+#include "path.h"
+#include "pc.h"
+#include "pet.h"
+#include "pet.h"
+#include "quest.h"
+#include "skill.h"
+#include "status.h"
+#include "status.h"
+#include "storage.h"
+#include "unit.h"
#include "../common/cbasetypes.h"
#include "../common/malloc.h"
#include "../common/md5calc.h"
@@ -10,47 +50,10 @@
#include "../common/showmsg.h"
#include "../common/socket.h" // usage: getcharip
#include "../common/strlib.h"
+#include "../common/sysinfo.h"
#include "../common/timer.h"
#include "../common/utils.h"
-#include "../common/sysinfo.h"
-
-#include "map.h"
-#include "path.h"
-#include "clif.h"
-#include "chrif.h"
-#include "itemdb.h"
-#include "pc.h"
-#include "status.h"
-#include "storage.h"
-#include "mob.h"
-#include "npc.h"
-#include "pet.h"
-#include "mapreg.h"
-#include "homunculus.h"
-#include "instance.h"
-#include "mercenary.h"
-#include "intif.h"
-#include "skill.h"
-#include "status.h"
-#include "chat.h"
-#include "battle.h"
-#include "battleground.h"
-#include "party.h"
-#include "guild.h"
-#include "atcommand.h"
-#include "log.h"
-#include "unit.h"
-#include "pet.h"
-#include "mail.h"
-#include "script.h"
-#include "quest.h"
-#include "elemental.h"
-#include "../config/core.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
#ifndef WIN32
#include <sys/time.h>
#endif
diff --git a/src/map/script.h b/src/map/script.h
index 90b18d87f..899c745da 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -5,17 +5,19 @@
#ifndef _MAP_SCRIPT_H_
#define _MAP_SCRIPT_H_
-#include "../common/strlib.h" //StringBuf
-#include "../common/cbasetypes.h"
-#include "map.h" //EVENT_NAME_LENGTH
-
#include <setjmp.h>
#include <errno.h>
+#include "map.h" //EVENT_NAME_LENGTH
+#include "../common/cbasetypes.h"
+#include "../common/db.h"
+#include "../common/mmo.h" // struct item
+#include "../common/sql.h" // Sql
+#include "../common/strlib.h" //StringBuf
+
/**
* Declarations
**/
-struct map_session_data;
struct eri;
/**
diff --git a/src/map/searchstore.c b/src/map/searchstore.c
index 0144aea93..72b28aacd 100644
--- a/src/map/searchstore.c
+++ b/src/map/searchstore.c
@@ -2,14 +2,17 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
+#define HERCULES_CORE
+
+#include "searchstore.h" // struct s_search_store_info
+
+#include "battle.h" // battle_config.*
+#include "clif.h" // clif->open_search_store_info, clif->search_store_info_*
+#include "pc.h" // struct map_session_data
#include "../common/cbasetypes.h"
#include "../common/malloc.h" // aMalloc, aRealloc, aFree
#include "../common/showmsg.h" // ShowError, ShowWarning
#include "../common/strlib.h" // safestrncpy
-#include "battle.h" // battle_config.*
-#include "clif.h" // clif->open_search_store_info, clif->search_store_info_*
-#include "pc.h" // struct map_session_data
-#include "searchstore.h" // struct s_search_store_info
struct searchstore_interface searchstore_s;
diff --git a/src/map/searchstore.h b/src/map/searchstore.h
index 827e39053..c9b93ba54 100644
--- a/src/map/searchstore.h
+++ b/src/map/searchstore.h
@@ -5,6 +5,12 @@
#ifndef _MAP_SEARCHSTORE_H_
#define _MAP_SEARCHSTORE_H_
+#include <time.h>
+
+#include "map.h" // MESSAGE_SIZE
+#include "../common/cbasetypes.h"
+#include "../common/mmo.h" // MAX_SLOTS
+
/**
* Defines
**/
diff --git a/src/map/skill.c b/src/map/skill.c
index c8388770a..b2e94ec79 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -2,46 +2,48 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/timer.h"
-#include "../common/nullpo.h"
-#include "../common/malloc.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/utils.h"
-#include "../common/ers.h"
+#define HERCULES_CORE
-#include "map.h"
-#include "path.h"
-#include "clif.h"
-#include "pc.h"
-#include "status.h"
+#include "../config/core.h" // DBPATH, MAGIC_REFLECTION_TYPE, OFFICIAL_WALKPATH, RENEWAL, RENEWAL_CAST, VARCAST_REDUCTION()
#include "skill.h"
-#include "pet.h"
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+#include "battle.h"
+#include "battleground.h"
+#include "chrif.h"
+#include "clif.h"
+#include "date.h"
+#include "elemental.h"
+#include "guild.h"
#include "homunculus.h"
+#include "intif.h"
+#include "itemdb.h"
+#include "log.h"
+#include "map.h"
#include "mercenary.h"
-#include "elemental.h"
#include "mob.h"
#include "npc.h"
-#include "battle.h"
-#include "battleground.h"
#include "party.h"
-#include "itemdb.h"
+#include "path.h"
+#include "pc.h"
+#include "pet.h"
#include "script.h"
-#include "intif.h"
-#include "log.h"
-#include "chrif.h"
-#include "guild.h"
-#include "date.h"
+#include "status.h"
#include "unit.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <math.h>
-
+#include "../common/cbasetypes.h"
+#include "../common/ers.h"
+#include "../common/malloc.h"
+#include "../common/nullpo.h"
+#include "../common/random.h"
+#include "../common/showmsg.h"
+#include "../common/strlib.h"
+#include "../common/timer.h"
+#include "../common/utils.h"
#define SKILLUNITTIMER_INTERVAL 100
diff --git a/src/map/skill.h b/src/map/skill.h
index dda310bd4..b6dbb1fcb 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -5,19 +5,23 @@
#ifndef _MAP_SKILL_H_
#define _MAP_SKILL_H_
-#include "../common/mmo.h" // MAX_SKILL, struct square
-#include "../common/db.h"
+#include "../config/core.h" // RENEWAL_CAST
+
#include "map.h" // struct block_list
+#include "status.h" // enum sc_type
+#include "../common/cbasetypes.h"
+#include "../common/db.h"
+#include "../common/mmo.h" // MAX_SKILL, struct square
/**
* Declarations
**/
-struct map_session_data;
struct homun_data;
+struct map_session_data;
+struct mercenary_data;
struct skill_unit;
-struct skill_unit_group;
-struct status_change_entry;
struct square;
+struct status_change_entry;
/**
* Defines
diff --git a/src/map/status.c b/src/map/status.c
index 4c2bc6d22..eb06138da 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -2,43 +2,46 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/timer.h"
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/malloc.h"
-#include "../common/utils.h"
-#include "../common/ers.h"
-#include "../common/strlib.h"
+#define HERCULES_CORE
+
+#include "../config/core.h" // ANTI_MAYAP_CHEAT, DBPATH, DEFTYPE_MAX, DEFTYPE_MIN, DEVOTION_REFLECT_DAMAGE, RENEWAL, RENEWAL_ASPD, RENEWAL_EDP
+#include "status.h"
+#include <math.h>
+#include <memory.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+#include "battle.h"
+#include "chrif.h"
+#include "clif.h"
+#include "elemental.h"
+#include "guild.h"
+#include "homunculus.h"
+#include "itemdb.h"
#include "map.h"
+#include "mercenary.h"
+#include "mob.h"
+#include "npc.h"
#include "path.h"
#include "pc.h"
#include "pet.h"
-#include "npc.h"
-#include "mob.h"
-#include "clif.h"
-#include "guild.h"
+#include "script.h"
#include "skill.h"
-#include "itemdb.h"
-#include "battle.h"
-#include "chrif.h"
#include "skill.h"
-#include "status.h"
-#include "script.h"
#include "unit.h"
-#include "homunculus.h"
-#include "mercenary.h"
-#include "elemental.h"
#include "vending.h"
-
-#include <time.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <memory.h>
-#include <string.h>
-#include <math.h>
+#include "../common/cbasetypes.h"
+#include "../common/ers.h"
+#include "../common/malloc.h"
+#include "../common/nullpo.h"
+#include "../common/random.h"
+#include "../common/showmsg.h"
+#include "../common/strlib.h"
+#include "../common/timer.h"
+#include "../common/utils.h"
struct status_interface status_s;
diff --git a/src/map/status.h b/src/map/status.h
index e47c2b365..baa586297 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -5,14 +5,18 @@
#ifndef _MAP_STATUS_H_
#define _MAP_STATUS_H_
+#include "../config/core.h" // defType, NEW_CARTS, RENEWAL, RENEWAL_ASPD
+
+#include "../common/cbasetypes.h"
#include "../common/mmo.h"
struct block_list;
-struct mob_data;
-struct pet_data;
+struct elemental_data;
struct homun_data;
struct mercenary_data;
-struct status_change;
+struct mob_data;
+struct npc_data;
+struct pet_data;
//Change the equation when the values are high enough to discard the
//imprecision in exchange of overflow protection [Skotlex]
@@ -1878,11 +1882,7 @@ struct status_interface {
int hp_coefficient2[CLASS_COUNT];
int hp_sigma_val[CLASS_COUNT][MAX_LEVEL+1];
int sp_coefficient[CLASS_COUNT];
-#ifdef RENEWAL_ASPD
- int aspd_base[CLASS_COUNT][MAX_WEAPON_TYPE+1];
-#else
- int aspd_base[CLASS_COUNT][MAX_WEAPON_TYPE]; //[blackhole89]
-#endif
+ int aspd_base[CLASS_COUNT][MAX_WEAPON_TYPE+1]; // +1 for RENEWAL_ASPD
sc_type Skill2SCTable[MAX_SKILL]; // skill -> status
int IconChangeTable[SC_MAX]; // status -> "icon" (icon is a bit of a misnomer, since there exist values with no icon associated)
unsigned int ChangeFlagTable[SC_MAX]; // status -> flags
diff --git a/src/map/storage.c b/src/map/storage.c
index e65ed7b80..2db5fff3d 100644
--- a/src/map/storage.c
+++ b/src/map/storage.c
@@ -2,28 +2,30 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
-#include "../common/nullpo.h"
-#include "../common/malloc.h"
-#include "../common/showmsg.h"
+#define HERCULES_CORE
-#include "map.h" // struct map_session_data
#include "storage.h"
-#include "chrif.h"
-#include "itemdb.h"
-#include "clif.h"
-#include "intif.h"
-#include "pc.h"
-#include "guild.h"
-#include "battle.h"
-#include "atcommand.h"
-#include "log.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "atcommand.h"
+#include "battle.h"
+#include "chrif.h"
+#include "clif.h"
+#include "guild.h"
+#include "intif.h"
+#include "itemdb.h"
+#include "log.h"
+#include "map.h" // struct map_session_data
+#include "pc.h"
+#include "../common/cbasetypes.h"
+#include "../common/db.h"
+#include "../common/malloc.h"
+#include "../common/nullpo.h"
+#include "../common/showmsg.h"
+
struct storage_interface storage_s;
struct guild_storage_interface gstorage_s;
diff --git a/src/map/storage.h b/src/map/storage.h
index 8f9f904f6..5edb68cfc 100644
--- a/src/map/storage.h
+++ b/src/map/storage.h
@@ -5,11 +5,12 @@
#ifndef _MAP_STORAGE_H_
#define _MAP_STORAGE_H_
-struct storage_data;
+#include "../common/cbasetypes.h"
+#include "../common/db.h"
+
struct guild_storage;
struct item;
struct map_session_data;
-struct DBMap;
struct storage_interface {
/* */
diff --git a/src/map/trade.c b/src/map/trade.c
index 44b669ebd..83426c407 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -2,25 +2,27 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/nullpo.h"
-#include "../common/socket.h"
+#define HERCULES_CORE
#include "trade.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include "atcommand.h"
+#include "battle.h"
+#include "chrif.h"
#include "clif.h"
+#include "intif.h"
#include "itemdb.h"
+#include "log.h"
#include "map.h"
+#include "npc.h"
#include "path.h"
#include "pc.h"
-#include "npc.h"
-#include "battle.h"
-#include "chrif.h"
#include "storage.h"
-#include "intif.h"
-#include "atcommand.h"
-#include "log.h"
-
-#include <stdio.h>
-#include <string.h>
+#include "../common/nullpo.h"
+#include "../common/socket.h"
struct trade_interface trade_s;
diff --git a/src/map/unit.c b/src/map/unit.c
index 151d4bad5..0ad770e80 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -2,45 +2,48 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/showmsg.h"
-#include "../common/timer.h"
-#include "../common/nullpo.h"
-#include "../common/db.h"
-#include "../common/malloc.h"
-#include "../common/random.h"
-#include "../common/HPM.h"
+#define HERCULES_CORE
+#include "../config/core.h" // RENEWAL_CAST
+#include "unit.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "battle.h"
+#include "battleground.h"
+#include "chat.h"
+#include "chrif.h"
+#include "clif.h"
+#include "duel.h"
+#include "elemental.h"
+#include "guild.h"
+#include "homunculus.h"
+#include "instance.h"
+#include "intif.h"
#include "map.h"
+#include "mercenary.h"
+#include "mob.h"
+#include "npc.h"
+#include "party.h"
#include "path.h"
#include "pc.h"
-#include "mob.h"
#include "pet.h"
-#include "homunculus.h"
-#include "instance.h"
-#include "mercenary.h"
-#include "elemental.h"
+#include "script.h"
#include "skill.h"
-#include "clif.h"
-#include "duel.h"
-#include "npc.h"
-#include "guild.h"
#include "status.h"
-#include "unit.h"
-#include "battle.h"
-#include "battleground.h"
-#include "chat.h"
+#include "storage.h"
#include "trade.h"
#include "vending.h"
-#include "party.h"
-#include "intif.h"
-#include "chrif.h"
-#include "script.h"
-#include "storage.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
+#include "../common/HPM.h"
+#include "../common/db.h"
+#include "../common/malloc.h"
+#include "../common/nullpo.h"
+#include "../common/random.h"
+#include "../common/showmsg.h"
+#include "../common/socket.h"
+#include "../common/timer.h"
const short dirx[8]={0,-1,-1,-1,0,1,1,1};
const short diry[8]={1,1,0,-1,-1,-1,0,1};
diff --git a/src/map/unit.h b/src/map/unit.h
index 33fa4e052..9e05647b1 100644
--- a/src/map/unit.h
+++ b/src/map/unit.h
@@ -5,15 +5,13 @@
#ifndef _MAP_UNIT_H_
#define _MAP_UNIT_H_
-//#include "map.h"
-struct block_list;
-struct unit_data;
-struct map_session_data;
-
#include "clif.h" // clr_type
-#include "map.h" // struct block_list
#include "path.h" // struct walkpath_data
-#include "skill.h" // struct skill_timerskill, struct skill_unit_group, struct skill_unit_group_tickset
+#include "skill.h" // 'MAX_SKILLTIMERSKILL, struct skill_timerskill, struct skill_unit_group, struct skill_unit_group_tickset
+#include "../common/cbasetypes.h"
+
+struct map_session_data;
+struct block_list;
struct unit_data {
struct block_list *bl;
diff --git a/src/map/vending.c b/src/map/vending.c
index 9462975b3..c8ac814db 100644
--- a/src/map/vending.c
+++ b/src/map/vending.c
@@ -2,24 +2,27 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#include "../common/nullpo.h"
-#include "../common/strlib.h"
-#include "../common/utils.h"
+#define HERCULES_CORE
+
+#include "vending.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include "atcommand.h"
+#include "battle.h"
+#include "chrif.h"
#include "clif.h"
#include "itemdb.h"
-#include "atcommand.h"
+#include "log.h"
#include "map.h"
+#include "npc.h"
#include "path.h"
-#include "chrif.h"
-#include "vending.h"
#include "pc.h"
-#include "npc.h"
#include "skill.h"
-#include "battle.h"
-#include "log.h"
-
-#include <stdio.h>
-#include <string.h>
+#include "../common/nullpo.h"
+#include "../common/strlib.h"
+#include "../common/utils.h"
struct vending_interface vending_s;
diff --git a/src/map/vending.h b/src/map/vending.h
index a212f8385..a70726374 100644
--- a/src/map/vending.h
+++ b/src/map/vending.h
@@ -7,6 +7,7 @@
#include "../common/cbasetypes.h"
#include "../common/db.h"
+
struct map_session_data;
struct s_search_store_search;