From ad9c0df5525237dcb29b7bb6ec718f9e8ffa75b5 Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 03:12:34 -0600 Subject: [PATCH 01/26] #include and forward declaration cleanup of client.cpp net.cpp questmgr.cpp zone.cpp zone.h --- zone/client.cpp | 14 ---------- zone/net.cpp | 2 +- zone/questmgr.cpp | 71 ++++++++++------------------------------------- zone/zone.cpp | 63 +++++++++++++++++++---------------------- zone/zone.h | 28 +++++-------------- 5 files changed, 51 insertions(+), 127 deletions(-) diff --git a/zone/client.cpp b/zone/client.cpp index 7ceb12496..e4f2c823a 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -17,13 +17,9 @@ */ #include "../common/debug.h" #include -#include -#include #include #include #include -#include -#include // for windows compile #ifdef _WINDOWS @@ -39,27 +35,17 @@ extern volatile bool RunLoops; #include "../common/features.h" -#include "../common/misc.h" #include "../common/spdat.h" -#include "../common/packet_dump.h" -#include "../common/packet_functions.h" -#include "../common/serverinfo.h" -#include "../common/zone_numbers.h" -#include "../common/moremath.h" #include "../common/guilds.h" -#include "../common/breakdowns.h" #include "../common/rulesys.h" #include "../common/string_util.h" #include "../common/data_verification.h" #include "net.h" -#include "masterentity.h" #include "worldserver.h" #include "zonedb.h" #include "petitions.h" -#include "forage.h" #include "command.h" #include "string_ids.h" -#include "npc_ai.h" #include "client_logs.h" #include "guild_mgr.h" #include "quest_parser_collection.h" diff --git a/zone/net.cpp b/zone/net.cpp index 498ed5102..034c30747 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -97,7 +97,7 @@ extern Zone* zone; EQStreamFactory eqsf(ZoneStream); npcDecayTimes_Struct npcCorpseDecayTimes[100]; TitleManager title_manager; -QueryServ *QServ = 0; +QueryServ *QServ = 0; TaskManager *taskmanager = 0; QuestParserCollection *parse = 0; diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 458a448d9..2ce1dbc37 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -16,66 +16,28 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* - -Assuming you want to add a new perl quest function named joe -that takes 1 integer argument.... - -1. Add the prototype to the quest manager: -questmgr.h: add (~line 50) - void joe(int arg); - -2. Define the actual function in questmgr.cpp: -void QuestManager::joe(int arg) { - //... do something -} - -3. Copy one of the XS routines in perlparser.cpp, preferably - one with the same number of arguments as your routine. Rename - as needed. - Finally, add your routine to the list at the bottom of perlparser.cpp - - -4. -If you want it to work in old mode perl and .qst, edit parser.cpp -Parser::ExCommands (~line 777) - else if (!strcmp(command,"joe")) { - quest_manager.joe(atoi(arglist[0])); - } - -And then at then end of embparser.cpp, add: -"sub joe{push(@cmd_queue,{func=>'joe',args=>join(',',@_)});}" - - - -*/ - -#include "../common/debug.h" -#include "entity.h" -#include "masterentity.h" -#include - -#include -#include -#include - -#include "worldserver.h" -#include "net.h" -#include "../common/skills.h" #include "../common/classes.h" -#include "../common/races.h" -#include "zonedb.h" +#include "../common/debug.h" +#include "../common/rulesys.h" +#include "../common/skills.h" #include "../common/spdat.h" -#include "../common/packet_functions.h" #include "../common/string_util.h" -#include "spawn2.h" -#include "zone.h" +#include "entity.h" #include "event_codes.h" #include "guild_mgr.h" -#include "../common/rulesys.h" +#include "net.h" #include "qglobals.h" -#include "quest_parser_collection.h" #include "queryserv.h" +#include "questmgr.h" +#include "quest_parser_collection.h" +#include "spawn2.h" +#include "worldserver.h" +#include "zone.h" +#include "zonedb.h" +#include +#include +#include + #ifdef BOTS #include "bot.h" #endif @@ -85,9 +47,6 @@ extern Zone* zone; extern WorldServer worldserver; extern EntityList entity_list; -#include "questmgr.h" - -//declare our global instance QuestManager quest_manager; #define QuestManagerCurrentQuestVars() \ diff --git a/zone/zone.cpp b/zone/zone.cpp index ecf10bcb5..9b42bfb68 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -15,17 +15,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" + +#include #include -#include +#include #include #include -#include -#include -#include #ifdef _WINDOWS -#include #define snprintf _snprintf #define vsnprintf _vsnprintf #else @@ -33,31 +30,26 @@ #include "../common/unix.h" #endif -#include "masterentity.h" +#include "../common/debug.h" #include "../common/features.h" -#include "spawngroup.h" -#include "spawn2.h" -#include "zone.h" -#include "worldserver.h" -#include "npc.h" -#include "net.h" -#include "../common/seperator.h" -#include "../common/packet_dump_file.h" -#include "../common/eq_stream_factory.h" -#include "../common/eq_stream.h" -#include "../common/string_util.h" -#include "zone_config.h" -#include "../common/breakdowns.h" -#include "map.h" -#include "water_map.h" -#include "object.h" -#include "petitions.h" -#include "pathing.h" -#include "event_codes.h" -#include "client_logs.h" #include "../common/rulesys.h" +#include "../common/seperator.h" +#include "../common/string_util.h" +#include "client_logs.h" #include "guild_mgr.h" +#include "map.h" +#include "net.h" +#include "npc.h" +#include "object.h" +#include "pathing.h" +#include "petitions.h" #include "quest_parser_collection.h" +#include "spawn2.h" +#include "spawngroup.h" +#include "water_map.h" +#include "worldserver.h" +#include "zone_config.h" +#include "zone.h" #ifdef _WINDOWS #define snprintf _snprintf @@ -65,18 +57,19 @@ #define strcasecmp _stricmp #endif - +extern bool staticzone; +extern NetConnection net; +extern PetitionList petition_list; +extern QuestParserCollection* parse; +extern uint16 adverrornum; +extern uint32 numclients; extern WorldServer worldserver; extern Zone* zone; -extern uint32 numclients; -extern NetConnection net; -extern uint16 adverrornum; -extern PetitionList petition_list; + Mutex MZoneShutdown; -extern bool staticzone; -Zone* zone = 0; + volatile bool ZoneLoaded = false; -extern QuestParserCollection* parse; +Zone* zone = 0; bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { const char* zonename = database.GetZoneName(iZoneID); diff --git a/zone/zone.h b/zone/zone.h index 0fa390512..2d74c9f17 100644 --- a/zone/zone.h +++ b/zone/zone.h @@ -18,25 +18,13 @@ #ifndef ZONE_H #define ZONE_H -#include "../common/mutex.h" -#include "../common/linked_list.h" -#include "../common/types.h" #include "../common/eqtime.h" -#include "../common/servertalk.h" +#include "../common/linked_list.h" #include "../common/rulesys.h" -#include "../common/eq_packet_structs.h" -#include "../common/features.h" -#include "spawngroup.h" -//#include "mob.h" -#include "zonedump.h" -#include "spawn2.h" -#include "tasks.h" -#include "pathing.h" +#include "../common/types.h" #include "qglobals.h" -#include - -class Map; -class WaterMap; +#include "spawn2.h" +#include "spawngroup.h" struct ZonePoint { @@ -78,12 +66,10 @@ struct item_tick_struct { std::string qglobal; }; -extern EntityList entity_list; -class database; +class Map; +class WaterMap; class PathManager; -struct SendAA_Struct; - -class database; +extern EntityList entity_list; class Zone { From 700de3f518a1a317822bbb5b18126995fb504a03 Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 03:24:48 -0600 Subject: [PATCH 02/26] questmgr.h forward declarations client_process.cpp #include removals --- zone/client_process.cpp | 36 +++++++++++------------------------- zone/questmgr.h | 4 +++- 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/zone/client_process.cpp b/zone/client_process.cpp index c07a73aea..2c391bd34 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -20,13 +20,8 @@ */ #include "../common/debug.h" #include -#include -#include -#include #include -#include #include -#include #ifdef _WINDOWS #include @@ -41,29 +36,20 @@ #include #endif -#include "masterentity.h" -#include "zonedb.h" -#include "../common/packet_functions.h" -#include "../common/packet_dump.h" -#include "worldserver.h" -#include "../common/packet_dump_file.h" -#include "../common/string_util.h" -#include "../common/spdat.h" -#include "petitions.h" -#include "npc_ai.h" -#include "../common/skills.h" -#include "forage.h" -#include "zone.h" -#include "event_codes.h" -#include "../common/faction.h" -#include "../common/crc32.h" #include "../common/rulesys.h" -#include "string_ids.h" -#include "map.h" +#include "../common/skills.h" +#include "../common/spdat.h" +#include "../common/string_util.h" +#include "event_codes.h" #include "guild_mgr.h" -#include -#include "quest_parser_collection.h" +#include "map.h" +#include "petitions.h" #include "queryserv.h" +#include "quest_parser_collection.h" +#include "string_ids.h" +#include "worldserver.h" +#include "zone.h" +#include "zonedb.h" extern QueryServ* QServ; extern Zone* zone; diff --git a/zone/questmgr.h b/zone/questmgr.h index 6b47bab04..dd471d74f 100644 --- a/zone/questmgr.h +++ b/zone/questmgr.h @@ -25,8 +25,10 @@ #include #include -class NPC; class Client; +class ItemInst; +class Mob; +class NPC; class QuestManager { struct running_quest { From 82e96d7014f2c86cda16b1d340a8b3f78a2e6f1b Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 03:48:26 -0600 Subject: [PATCH 03/26] client_packet.cpp #include cleanup --- zone/client_packet.cpp | 46 +++++++++++++++--------------------------- zone/client_packet.h | 4 ++-- 2 files changed, 18 insertions(+), 32 deletions(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index a12247cc6..8f2450621 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -16,14 +16,11 @@ */ #include "../common/debug.h" -#include #include #include #include #include -#include #include -#include #include #include @@ -38,39 +35,28 @@ #include #endif -#include "../common/packet_functions.h" -#include "../common/packet_dump.h" -#include "worldserver.h" -#include "../common/rdtsc.h" -#include "../common/packet_dump_file.h" -#include "../common/string_util.h" -#include "../common/breakdowns.h" -#include "../common/guilds.h" -#include "../common/rulesys.h" -#include "../common/spdat.h" -#include "../common/data_verification.h" -#include "petitions.h" -#include "npc_ai.h" -#include "../common/skills.h" -#include "forage.h" -#include "zone.h" -#include "event_codes.h" -#include "../common/faction.h" #include "../common/crc32.h" +#include "../common/data_verification.h" +#include "../common/faction.h" +#include "../common/guilds.h" +#include "../common/rdtsc.h" +#include "../common/rulesys.h" +#include "../common/skills.h" +#include "../common/spdat.h" +#include "../common/string_util.h" +#include "../common/zone_numbers.h" +#include "event_codes.h" +#include "guild_mgr.h" +#include "merc.h" +#include "petitions.h" +#include "pets.h" +#include "queryserv.h" +#include "quest_parser_collection.h" #include "string_ids.h" #include "titles.h" #include "water_map.h" #include "worldserver.h" #include "zone.h" -#include "zone_config.h" -#include "guild_mgr.h" -#include "pathing.h" -#include "water_map.h" -#include "merc.h" -#include "pets.h" -#include "../common/zone_numbers.h" -#include "quest_parser_collection.h" -#include "queryserv.h" extern QueryServ* QServ; extern Zone* zone; diff --git a/zone/client_packet.h b/zone/client_packet.h index 0868b93ba..51b6713b7 100644 --- a/zone/client_packet.h +++ b/zone/client_packet.h @@ -1,4 +1,4 @@ - // connecting opcode handlers + /* Connecting OpCode Handlers */ void Handle_Connect_0x3e33(const EQApplicationPacket *app); void Handle_Connect_OP_ApproveZone(const EQApplicationPacket *app); void Handle_Connect_OP_ClientError(const EQApplicationPacket *app); @@ -20,7 +20,7 @@ void Handle_Connect_OP_WorldObjectsSent(const EQApplicationPacket *app); void Handle_Connect_OP_ZoneComplete(const EQApplicationPacket *app); void Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app); - // connected opcode handlers + /* Connected opcode handlers*/ void Handle_0x0193(const EQApplicationPacket *app); void Handle_0x01e7(const EQApplicationPacket *app); void Handle_OP_AAAction(const EQApplicationPacket *app); From 8da864bada536099577fcc4b8c8340f07e85f2d3 Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 03:54:25 -0600 Subject: [PATCH 04/26] command.cpp #include cleanup command.h forward declaration --- zone/command.cpp | 27 +++++++++++---------------- zone/command.h | 3 +++ 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/zone/command.cpp b/zone/command.cpp index 12241de52..c9bef2e12 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -42,27 +42,22 @@ #endif #include "../common/debug.h" -#include "../common/ptimer.h" -#include "../common/packet_functions.h" -#include "../common/packet_dump.h" -#include "../common/serverinfo.h" -#include "../common/opcodemgr.h" #include "../common/eq_packet.h" -#include "../common/guilds.h" -#include "../common/rulesys.h" -#include "../common/string_util.h" -//#include "../common/servertalk.h" // for oocmute and revoke -#include "worldserver.h" -#include "masterentity.h" -#include "map.h" -#include "water_map.h" #include "../common/features.h" -#include "pathing.h" +#include "../common/guilds.h" +#include "../common/patches/patches.h" +#include "../common/ptimer.h" +#include "../common/rulesys.h" +#include "../common/serverinfo.h" +#include "../common/string_util.h" #include "client_logs.h" #include "guild_mgr.h" -#include "titles.h" -#include "../common/patches/patches.h" +#include "map.h" +#include "pathing.h" #include "queryserv.h" +#include "titles.h" +#include "water_map.h" +#include "worldserver.h" extern QueryServ* QServ; extern WorldServer worldserver; diff --git a/zone/command.h b/zone/command.h index db069b57c..ea710482b 100644 --- a/zone/command.h +++ b/zone/command.h @@ -20,6 +20,9 @@ #ifndef COMMAND_H #define COMMAND_H +class Client; +class Seperator; + #include "../common/seperator.h" #include "../common/eq_stream.h" #include "client.h" From 6d763256f148faf9da95fdcf22bad859faa48871 Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 04:04:49 -0600 Subject: [PATCH 05/26] client_mods.cpp cleanup --- zone/client_mods.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index 5431b2dfe..55b522378 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -18,23 +18,17 @@ #include #include "../common/debug.h" -#include "../common/spdat.h" -#include "../common/packet_dump.h" -#include "../common/packet_functions.h" -#include "../common/serverinfo.h" -#include "../common/zone_numbers.h" -#include "../common/moremath.h" -#include "../common/guilds.h" #include "../common/logsys.h" +#include "../common/spdat.h" +#include "../common/rulesys.h" #include "masterentity.h" -#include "worldserver.h" -#include "zonedb.h" +#include "npc_ai.h" #include "petitions.h" #include "string_ids.h" -#include "npc_ai.h" +#include "worldserver.h" +#include "zonedb.h" -// Return max stat value for level int32 Client::GetMaxStat() const { if((RuleI(Character, StatCap)) > 0) From e833f457a1e7e3b6f2cf6d1ae656de85fa17c21e Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 04:08:37 -0600 Subject: [PATCH 06/26] inventory.cpp #include clean/remove --- zone/inventory.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/zone/inventory.cpp b/zone/inventory.cpp index a7f61819e..d290658d0 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -15,24 +15,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "../common/debug.h" -#include "masterentity.h" -#include "worldserver.h" -#include "net.h" -#include "zonedb.h" -#include "../common/spdat.h" -#include "../common/packet_dump.h" -#include "../common/packet_functions.h" -#include "petitions.h" -#include "../common/serverinfo.h" -#include "../common/zone_numbers.h" -#include "../common/moremath.h" -#include "../common/guilds.h" #include "../common/logsys.h" #include "../common/string_util.h" -#include "string_ids.h" -#include "npc_ai.h" #include "quest_parser_collection.h" +#include "worldserver.h" +#include "zonedb.h" extern WorldServer worldserver; // @merth: this needs to be touched up From 251e940fe83f494dd7f4bad2a6584cb996fb51ea Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 04:18:18 -0600 Subject: [PATCH 07/26] zonedb.h forward declarations zonedb.cpp #include cleanup --- zone/inventory.cpp | 1 + zone/zonedb.cpp | 19 +++++++------------ zone/zonedb.h | 26 +++++++++++++++++--------- 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/zone/inventory.cpp b/zone/inventory.cpp index d290658d0..6b7a0b297 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -22,6 +22,7 @@ #include "quest_parser_collection.h" #include "worldserver.h" #include "zonedb.h" + extern WorldServer worldserver; // @merth: this needs to be touched up diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 8bc696888..1f520ed88 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -1,21 +1,16 @@ -#include "zonedb.h" -#include "../common/item.h" -#include "../common/string_util.h" #include "../common/extprofile.h" -#include "../common/guilds.h" +#include "../common/item.h" #include "../common/rulesys.h" -#include "../common/rdtsc.h" -#include "zone.h" -#include "corpse.h" +#include "../common/string_util.h" #include "client.h" -#include "merc.h" +#include "corpse.h" #include "groups.h" -#include "raids.h" -#include -#include -#include +#include "merc.h" +#include "zone.h" +#include "zonedb.h" #include +#include extern Zone* zone; diff --git a/zone/zonedb.h b/zone/zonedb.h index 3f8719946..5adc893ff 100644 --- a/zone/zonedb.h +++ b/zone/zonedb.h @@ -3,10 +3,24 @@ #include "../common/shareddb.h" #include "../common/eq_packet_structs.h" -#include "../common/loottable.h" -#include "zonedump.h" #include "../common/faction.h" -#include + +class Client; +class Corpse; +class Merc; +class NPC; +class Petition; +class Spawn2; +class SpawnGroupList; +class ItemInst; +struct CharacterEventLog_Struct; +struct Door; +struct ExtendedProfile_Struct; +struct NPCType; +struct PlayerCorpse_Struct; +struct ZonePoint; +struct npcDecayTimes_Struct; +template class LinkedList; //#include "doors.h" @@ -201,12 +215,6 @@ struct ClientMercEntry { uint32 npcid; }; -class ItemInst; -struct FactionMods; -struct FactionValue; -struct LootTable_Struct; - - class ZoneDatabase : public SharedDatabase { typedef std::list ItemList; public: From 5d5c3fbfd1784bdcf75311bd3c8eb576371720bd Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 04:30:03 -0600 Subject: [PATCH 08/26] database.h forward declaration database.cpp #include house-keeping --- common/database.cpp | 16 ++++++---------- common/database.h | 11 +++-------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index e950d8bd4..4cafc56d1 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -17,19 +17,16 @@ */ #include "../common/debug.h" #include "../common/rulesys.h" -#include -#include +#include +#include #include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include -#include -#include // Disgrace: for windows compile #ifdef _WINDOWS @@ -45,7 +42,6 @@ #include "database.h" #include "eq_packet_structs.h" -#include "guilds.h" #include "string_util.h" #include "extprofile.h" diff --git a/common/database.h b/common/database.h index 9be14f1cb..6325b4e3d 100644 --- a/common/database.h +++ b/common/database.h @@ -41,6 +41,7 @@ class SpawnGroupList; class Petition; class Client; class Merc; +class MySQLRequestResult; struct Combine_Struct; //struct Faction; //struct FactionMods; @@ -68,21 +69,15 @@ uint8 eventid; EventLogDetails_Struct eld[255]; }; - -// Added By Hogie -// INSERT into variables (varname,value) values('decaytime [minlevel] [maxlevel]','[number of seconds]'); -// IE: decaytime 1 54 = Levels 1 through 54 -// decaytime 55 100 = Levels 55 through 100 -// It will always put the LAST time for the level (I think) from the Database struct npcDecayTimes_Struct { uint16 minlvl; uint16 maxlvl; uint32 seconds; }; -// Added By Hogie -- End + struct VarCache_Struct { - char varname[26]; // varname is char(25) in database + char varname[26]; char value[0]; }; From 4faca5543ace09b9db836e73ebf80be2a9f6e544 Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 04:56:42 -0600 Subject: [PATCH 09/26] net.h cleanup --- zone/net.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/zone/net.h b/zone/net.h index e81dd6d51..c49e1ec8e 100644 --- a/zone/net.h +++ b/zone/net.h @@ -26,9 +26,6 @@ #include #endif - -#include -#include #include "../common/types.h" #include "../common/timer.h" void CatchSignal(int); From 904ae416c51d4c7d439182d3dad6c4e9d03fdb58 Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 05:01:49 -0600 Subject: [PATCH 10/26] Small world server cleanup --- zone/worldserver.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/zone/worldserver.h b/zone/worldserver.h index 6feead496..c1e86421f 100644 --- a/zone/worldserver.h +++ b/zone/worldserver.h @@ -20,12 +20,10 @@ #include "../common/worldconn.h" #include "../common/eq_packet_structs.h" -#include -struct GuildJoin_Struct; +class ServerPacket; class EQApplicationPacket; class Client; -class Database; class WorldServer : public WorldConnection { public: From 35e9c3ad9804128b9971b1230eae0758778e45e3 Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 05:22:27 -0600 Subject: [PATCH 11/26] special_attacks.cpp #include clean --- zone/special_attacks.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 3625c9180..6c29cade1 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -14,19 +14,18 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + */ + + #include "../common/debug.h" -#include -#include -#include -#include - -#include "masterentity.h" -#include "string_ids.h" #include "../common/misc_functions.h" #include "../common/rulesys.h" #include "../common/string_util.h" +#include "masterentity.h" +#include "string_ids.h" +#include +#include int Mob::GetKickDamage() { From 7db731a47de5b4c84611838a9a1fb2236af5a7d0 Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 14:07:40 -0600 Subject: [PATCH 12/26] net.cpp #include cleanup net.cpp forward declaration --- zone/net.cpp | 89 ++++++++++++++++++++++------------------------------ 1 file changed, 38 insertions(+), 51 deletions(-) diff --git a/zone/net.cpp b/zone/net.cpp index 034c30747..e82a29bca 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -18,57 +18,39 @@ #define DONT_SHARED_OPCODES -#include "../common/debug.h" -#include "../common/features.h" -#include "../common/queue.h" -#include "../common/timer.h" -#include "../common/eq_stream.h" -#include "../common/eq_stream_factory.h" -#include "../common/eq_packet_structs.h" -#include "../common/mutex.h" -#include "../common/version.h" -#include "../common/eqemu_error.h" -#include "../common/packet_dump_file.h" -#include "../common/opcodemgr.h" -#include "../common/guilds.h" -#include "../common/eq_stream_ident.h" -#include "../common/patches/patches.h" -#include "../common/rulesys.h" -#include "../common/misc_functions.h" -#include "../common/string_util.h" -#include "../common/platform.h" + #include "../common/crash.h" +#include "../common/debug.h" +#include "../common/eq_stream_factory.h" +#include "../common/eq_stream_ident.h" +#include "../common/eqemu_error.h" +#include "../common/eqemu_exception.h" +#include "../common/features.h" #include "../common/ipc_mutex.h" #include "../common/memory_mapped_file.h" -#include "../common/eqemu_exception.h" +#include "../common/patches/patches.h" +#include "../common/platform.h" +#include "../common/rulesys.h" #include "../common/spdat.h" +#include "../common/timer.h" +#include "../common/version.h" -#include "zone_config.h" -#include "masterentity.h" -#include "worldserver.h" -#include "net.h" -#include "zone.h" -#include "queryserv.h" -#include "command.h" -#include "zone_config.h" -#include "titles.h" -#include "guild_mgr.h" -#include "tasks.h" - -#include "quest_parser_collection.h" -#include "embparser.h" -#include "lua_parser.h" #include "client_logs.h" +#include "command.h" +#include "embparser.h" +#include "guild_mgr.h" +#include "lua_parser.h" +#include "net.h" +#include "queryserv.h" +#include "quest_parser_collection.h" #include "questmgr.h" +#include "tasks.h" +#include "titles.h" +#include "worldserver.h" +#include "zone_config.h" +#include "zone.h" -#include -#include -#include - -#include -#include #include -#include #ifdef _CRTDBG_MAP_ALLOC #undef new @@ -86,20 +68,25 @@ volatile bool RunLoops = true; extern volatile bool ZoneLoaded; -TimeoutManager timeout_manager; -NetConnection net; -EntityList entity_list; -WorldServer worldserver; -uint32 numclients = 0; +class EQStream; +class EQStreamInterface; + char errorname[32]; -uint16 adverrornum = 0; -extern Zone* zone; +EntityList entity_list; EQStreamFactory eqsf(ZoneStream); +extern Zone* zone; +NetConnection net; npcDecayTimes_Struct npcCorpseDecayTimes[100]; -TitleManager title_manager; QueryServ *QServ = 0; -TaskManager *taskmanager = 0; QuestParserCollection *parse = 0; +TaskManager *taskmanager = 0; +TimeoutManager timeout_manager; +TitleManager title_manager; +WorldServer worldserver; + +uint16 adverrornum = 0; +uint32 numclients = 0; + const SPDat_Spell_Struct* spells; void LoadSpells(EQEmu::MemoryMappedFile **mmf); From b06fec6ad0a5e5482d8ce4a0ba9a029c6efa64a5 Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 14:11:16 -0600 Subject: [PATCH 13/26] attack.cpp #include cleanup --- zone/attack.cpp | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index ef18f6fae..65c3fd9d1 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -21,28 +21,22 @@ #endif #include "../common/debug.h" -#include -#include -#include -#include -#include -#include - -#include "masterentity.h" -#include "npc_ai.h" -#include "../common/packet_dump.h" -#include "../common/eq_packet_structs.h" #include "../common/eq_constants.h" +#include "../common/eq_packet_structs.h" +#include "../common/rulesys.h" #include "../common/skills.h" #include "../common/spdat.h" -#include "zone.h" -#include "string_ids.h" #include "../common/string_util.h" -#include "../common/rulesys.h" +#include "queryserv.h" #include "quest_parser_collection.h" +#include "string_ids.h" #include "water_map.h" #include "worldserver.h" -#include "queryserv.h" +#include "zone.h" + +#include +#include +#include extern QueryServ* QServ; extern WorldServer worldserver; From ad603fd213e429bfea0042c0c7ad3d9d92c42510 Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 14:39:27 -0600 Subject: [PATCH 14/26] loottable.cpp #include fix, previously reliant on npc.h to get to loottable.h npc.cpp #include cleanup npc.h #include cleanup and forward declaration --- zone/loottables.cpp | 1 + zone/npc.cpp | 50 +++++++++++++++++++++++---------------------- zone/npc.h | 27 ++++++++++++------------ 3 files changed, 41 insertions(+), 37 deletions(-) diff --git a/zone/loottables.cpp b/zone/loottables.cpp index 0c66778bd..121dad8c5 100644 --- a/zone/loottables.cpp +++ b/zone/loottables.cpp @@ -22,6 +22,7 @@ #include "npc.h" #include "masterentity.h" #include "zonedb.h" +#include "../common/loottable.h" #include "../common/misc_functions.h" #ifdef _WINDOWS #define snprintf _snprintf diff --git a/zone/npc.cpp b/zone/npc.cpp index eae42b670..b8d838d6d 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -15,15 +15,34 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "../common/bodytypes.h" +#include "../common/classes.h" #include "../common/debug.h" -#include -#include -#include -#include -#include "../common/moremath.h" -#include -#include "../common/packet_dump_file.h" +#include "../common/misc_functions.h" +#include "../common/rulesys.h" +#include "../common/seperator.h" +#include "../common/spdat.h" +#include "../common/string_util.h" +#include "../common/clientversions.h" +#include "../common/features.h" // +#include "../common/item.h" // +#include "../common/item_struct.h" // +#include "../common/linked_list.h" // +#include "../common/servertalk.h" + +#include "aa.h" +#include "client.h" +#include "entity.h" +#include "npc.h" +#include "string_ids.h" +#include "spawn2.h" #include "zone.h" + +#include +#include +#include + #ifdef _WINDOWS #define snprintf _snprintf #define strncasecmp _strnicmp @@ -33,27 +52,10 @@ #include #endif -#include "npc.h" -#include "map.h" -#include "entity.h" -#include "masterentity.h" -#include "../common/spdat.h" -#include "../common/bodytypes.h" -#include "spawngroup.h" -#include "../common/misc_functions.h" -#include "../common/string_util.h" -#include "../common/rulesys.h" -#include "string_ids.h" - -//#define SPELLQUEUE //Use only if you want to be spammed by spell testing - - extern Zone* zone; extern volatile bool ZoneLoaded; extern EntityList entity_list; -#include "quest_parser_collection.h" - NPC::NPC(const NPCType* d, Spawn2* in_respawn, float x, float y, float z, float heading, int iflymode, bool IsCorpse) : Mob(d->name, d->lastname, diff --git a/zone/npc.h b/zone/npc.h index a88ae9176..cccf3ecf0 100644 --- a/zone/npc.h +++ b/zone/npc.h @@ -18,20 +18,17 @@ #ifndef NPC_H #define NPC_H -class NPC; -#include "zonedb.h" -#include "mob.h" -//#include "spawn.h" - -#include -#include - -#include "spawn2.h" -#include "../common/loottable.h" -#include "zonedump.h" -#include "qglobals.h" #include "../common/rulesys.h" +#include "mob.h" +#include "qglobals.h" +#include "zonedb.h" +#include "zonedump.h" + +#include +#include + + #ifdef _WINDOWS #define M_PI 3.141592 #endif @@ -88,8 +85,12 @@ struct AISpellsVar_Struct { uint8 idle_beneficial_chance; }; - class AA_SwarmPetInfo; +class Client; +class Group; +class Raid; +class Spawn2; +struct Item_Struct; class NPC : public Mob { From cb6948b6fd526103b55a538498075d00aa46e303 Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 15:02:34 -0600 Subject: [PATCH 15/26] npc.cpp #include cleanup entity.cpp #include cleanup --- zone/entity.cpp | 18 +++++++----------- zone/npc.cpp | 8 ++++---- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 781e1164e..cae20c3ce 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include @@ -30,19 +29,16 @@ #include "../common/unix.h" #endif -#include "net.h" -#include "masterentity.h" -#include "worldserver.h" -#include "../common/guilds.h" -#include "../common/packet_dump.h" -#include "../common/packet_functions.h" -#include "petitions.h" -#include "../common/spdat.h" #include "../common/features.h" -#include "string_ids.h" +#include "../common/guilds.h" +#include "../common/spdat.h" #include "guild_mgr.h" -#include "raids.h" +#include "net.h" +#include "petitions.h" #include "quest_parser_collection.h" +#include "raids.h" +#include "string_ids.h" +#include "worldserver.h" #ifdef _WINDOWS #define snprintf _snprintf diff --git a/zone/npc.cpp b/zone/npc.cpp index b8d838d6d..b5716e845 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -25,10 +25,10 @@ #include "../common/spdat.h" #include "../common/string_util.h" #include "../common/clientversions.h" -#include "../common/features.h" // -#include "../common/item.h" // -#include "../common/item_struct.h" // -#include "../common/linked_list.h" // +#include "../common/features.h" +#include "../common/item.h" +#include "../common/item_struct.h" +#include "../common/linked_list.h" #include "../common/servertalk.h" #include "aa.h" From 6d52f3c02aa6289d171725c7ddc555373129f77b Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 15:08:16 -0600 Subject: [PATCH 16/26] aa.cpp #include cleanup aa.h #include cleanup --- zone/aa.cpp | 78 ++++++++++------------------------------------------- zone/aa.h | 3 ++- 2 files changed, 16 insertions(+), 65 deletions(-) diff --git a/zone/aa.cpp b/zone/aa.cpp index 3a3101746..a8c6ff3d0 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -16,84 +16,34 @@ Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net) Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// Test 1 - -#include - -#include "../common/debug.h" -#include "aa.h" -#include "mob.h" -#include "client.h" -#include "groups.h" -#include "raids.h" -#include "../common/spdat.h" -#include "object.h" -#include "doors.h" -#include "beacon.h" -#include "corpse.h" -#include "titles.h" -#include "../common/races.h" #include "../common/classes.h" +#include "../common/debug.h" #include "../common/eq_packet_structs.h" #include "../common/packet_dump.h" +#include "../common/races.h" +#include "../common/spdat.h" #include "../common/string_util.h" -#include "../common/logsys.h" -#include "zonedb.h" -#include "string_ids.h" + +#include "aa.h" +#include "client.h" +#include "corpse.h" +#include "groups.h" +#include "mob.h" #include "queryserv.h" +#include "raids.h" +#include "string_ids.h" +#include "titles.h" +#include "zonedb.h" extern QueryServ* QServ; -//static data arrays, really not big enough to warrant shared mem. + AA_DBAction AA_Actions[aaHighestID][MAX_AA_ACTION_RANKS]; //[aaid][rank] std::mapaas_send; std::map > aa_effects; //stores the effects from the aa_effects table in memory std::map AARequiredLevelAndCost; -/* - -Schema: - -spell_id is spell to cast, SPELL_UNKNOWN == no spell -nonspell_action is action to preform on activation which is not a spell, 0=none -nonspell_mana is mana that the nonspell action consumes -nonspell_duration is a duration which may be used by the nonspell action -redux_aa is the aa which reduces the reuse timer of the skill -redux_rate is the multiplier of redux_aa, as a percentage of total rate (10 == 10% faster) - -CREATE TABLE aa_actions ( - aaid mediumint unsigned not null, - rank tinyint unsigned not null, - reuse_time mediumint unsigned not null, - spell_id mediumint unsigned not null, - target tinyint unsigned not null, - nonspell_action tinyint unsigned not null, - nonspell_mana mediumint unsigned not null, - nonspell_duration mediumint unsigned not null, - redux_aa mediumint unsigned not null, - redux_rate tinyint not null, - - PRIMARY KEY(aaid, rank) -); - -CREATE TABLE aa_swarmpets ( - spell_id mediumint unsigned not null, - count tinyint unsigned not null, - npc_id int not null, - duration mediumint unsigned not null, - PRIMARY KEY(spell_id) -); -*/ - -/* - -Credits for this function: - -FatherNitwit: Structure and mechanism - -Wiz: Initial set of AAs, original function contents - -Branks: Much updated info and a bunch of higher-numbered AAs - -*/ int Client::GetAATimerID(aaID activate) { SendAA_Struct* aa2 = zone->FindAA(activate); diff --git a/zone/aa.h b/zone/aa.h index b143aae9a..00f74e8c6 100644 --- a/zone/aa.h +++ b/zone/aa.h @@ -2,7 +2,8 @@ #ifndef AA_H #define AA_H -#include "../common/eq_packet_structs.h" +struct AA_Ability; +struct SendAA_Struct; #define MANA_BURN 664 From 88984a3960a1a194a68ed8d4f304fc3db913e841 Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 15:44:09 -0600 Subject: [PATCH 17/26] petitions.cpp #include cleanup petititons.h #include cleanup --- zone/petitions.cpp | 15 +++------------ zone/petitions.h | 10 ++++++---- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/zone/petitions.cpp b/zone/petitions.cpp index ba57fe7f2..ad38bc04d 100644 --- a/zone/petitions.cpp +++ b/zone/petitions.cpp @@ -16,10 +16,6 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org) Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "../common/debug.h" -#include -#include -#include -#include #include #ifdef _WINDOWS #include @@ -32,16 +28,12 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org) #define strncasecmp _strnicmp #define strcasecmp _stricmp #endif -#include "../common/string_util.h" -#include "../common/packet_functions.h" -#include "../common/packet_dump.h" -#include "../common/packet_dump_file.h" -#include "../common/emu_opcodes.h" + + #include "../common/eq_packet_structs.h" #include "../common/servertalk.h" +#include "../common/string_util.h" #include "entity.h" -#include "masterentity.h" - #include "petitions.h" #include "worldserver.h" @@ -49,7 +41,6 @@ PetitionList petition_list; extern WorldServer worldserver; - void Petition::SendPetitionToPlayer(Client* clientto) { EQApplicationPacket* outapp = new EQApplicationPacket(OP_PetitionCheckout,sizeof(Petition_Struct)); Petition_Struct* pet = (Petition_Struct*) outapp->pBuffer; diff --git a/zone/petitions.h b/zone/petitions.h index 4b68362e0..604d4ddcc 100644 --- a/zone/petitions.h +++ b/zone/petitions.h @@ -19,11 +19,13 @@ #define PETITIONS_H #include "../common/linked_list.h" -#include "../common/types.h" -#include "zonedb.h" -#include "client.h" -#include "../common/mutex.h" #include "../common/misc_functions.h" +#include "../common/mutex.h" +#include "../common/types.h" +#include "client.h" +#include "zonedb.h" + +class Client; class Petition { From 3577ff5a8135a8f29a366bdf410e86c46baa43ab Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 15:53:17 -0600 Subject: [PATCH 18/26] waypoints.cpp #include cleanup --- zone/waypoints.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index cfefe73f3..908f0f946 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -19,21 +19,17 @@ #ifdef _EQDEBUG #include #endif -//#include -#include -#include -#include "npc.h" -#include "masterentity.h" -#include "npc_ai.h" -#include "map.h" -#include "water_map.h" -#include "../common/moremath.h" -#include "string_ids.h" -#include "../common/misc_functions.h" -#include "../common/string_util.h" -#include "../common/rulesys.h" + #include "../common/features.h" +#include "../common/misc_functions.h" +#include "../common/rulesys.h" +#include "../common/string_util.h" +#include "map.h" +#include "npc.h" #include "quest_parser_collection.h" +#include "water_map.h" +#include +#include struct wp_distance { From 2d052a7a283f1617008b60a01cd1890d5eebc834 Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 15:56:51 -0600 Subject: [PATCH 19/26] mod_functions.cpp #include cleanup --- zone/mod_functions.cpp | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/zone/mod_functions.cpp b/zone/mod_functions.cpp index b948dff38..6ae0eddad 100644 --- a/zone/mod_functions.cpp +++ b/zone/mod_functions.cpp @@ -1,22 +1,15 @@ -#include "../common/debug.h" -#include "../common/timer.h" -#include -#include -#include "spawn2.h" -#include "entity.h" -#include "masterentity.h" -#include "zone.h" -#include "spawngroup.h" -#include "zonedb.h" -#include "npc.h" -#include "mob.h" #include "client.h" +#include "entity.h" +#include "mob.h" +#include "npc.h" #include "worldserver.h" -#include "quest_parser_collection.h" -#include "event_codes.h" -#include "embparser.h" -#include -#include +#include "zone.h" + +class ItemInst; +class Spawn2; +struct Consider_Struct; +struct DBTradeskillRecipe_Struct; +struct Item_Struct; extern EntityList entity_list; extern Zone* zone; From f5ba442ba69dae323e602562ab388cd02fa9fe2f Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 15:59:24 -0600 Subject: [PATCH 20/26] spells.cpp #include cleanup --- zone/spells.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/zone/spells.cpp b/zone/spells.cpp index 1b78030e6..3bdc3557e 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -66,20 +66,19 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org) and not SpellFinished(). */ -#include "../common/debug.h" -#include "../common/spdat.h" -#include "masterentity.h" -#include "../common/packet_dump.h" -#include "../common/moremath.h" -#include "../common/item.h" -#include "worldserver.h" -#include "../common/skills.h" #include "../common/bodytypes.h" #include "../common/classes.h" +#include "../common/debug.h" +#include "../common/item.h" #include "../common/rulesys.h" +#include "../common/skills.h" +#include "../common/spdat.h" #include "../common/string_util.h" -#include +#include "quest_parser_collection.h" +#include "string_ids.h" +#include "worldserver.h" #include +#include #ifndef WIN32 #include @@ -90,8 +89,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org) #include "../common/packet_dump_file.h" #endif -#include "string_ids.h" -#include "quest_parser_collection.h" + extern Zone* zone; extern volatile bool ZoneLoaded; From c7a79d81ca3100ee097f2fd384f3808bdb0356e7 Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 16:28:48 -0600 Subject: [PATCH 21/26] pets.cpp #include cleanup --- zone/pets.cpp | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/zone/pets.cpp b/zone/pets.cpp index 1f61b227b..cf9ecab8c 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -15,30 +15,26 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "../common/debug.h" +#include "../common/misc_functions.h" #include "../common/spdat.h" -#include "masterentity.h" -#include "../common/packet_dump.h" -#include "../common/moremath.h" -#include "../common/item.h" -#include "zonedb.h" -#include "worldserver.h" -#include "../common/skills.h" -#include "../common/bodytypes.h" -#include "../common/classes.h" #include "../common/string_util.h" +#include "../common/types.h" + +#include "entity.h" +#include "client.h" +#include "mob.h" + #include "pets.h" -#include -#include +#include "worldserver.h" +#include "zonedb.h" + #ifndef WIN32 #include #include "../common/unix.h" #endif -#include "string_ids.h" - -/////////////////////////////////////////////////////////////////////////////// -// pet related functions const char *GetRandPetName() { From 9821c7da6518247bf3f1fbd2632b167ef8d7fa72 Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 16:32:49 -0600 Subject: [PATCH 22/26] zoning.cpp #include cleanup --- zone/zoning.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/zone/zoning.cpp b/zone/zoning.cpp index 6ac85cff6..71ea65dc8 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -15,17 +15,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" -#include "zone.h" -#include "worldserver.h" -#include "masterentity.h" -#include "../common/packet_dump.h" +#include "../common/debug.h" #include "../common/rulesys.h" #include "../common/string_util.h" -#include "string_ids.h" -#include "quest_parser_collection.h" #include "queryserv.h" +#include "quest_parser_collection.h" +#include "string_ids.h" +#include "worldserver.h" +#include "zone.h" extern QueryServ* QServ; extern WorldServer worldserver; From 55620305949a515c4427594d3c33319f1b9bcce3 Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 16:43:19 -0600 Subject: [PATCH 23/26] guild.cpp #include cleanup spell_effects.cpp #include cleanup --- zone/guild.cpp | 16 +++------------- zone/spell_effects.cpp | 20 +++++++++----------- 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/zone/guild.cpp b/zone/guild.cpp index 5f8378d2b..58b0f006e 100644 --- a/zone/guild.cpp +++ b/zone/guild.cpp @@ -15,23 +15,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" -#include "masterentity.h" -#include "worldserver.h" -#include "net.h" + #include "../common/database.h" -#include "../common/spdat.h" -#include "../common/packet_dump.h" -#include "../common/packet_functions.h" -#include "petitions.h" -#include "../common/serverinfo.h" -#include "../common/zone_numbers.h" -#include "../common/moremath.h" #include "../common/guilds.h" #include "../common/string_util.h" + #include "guild_mgr.h" -#include "string_ids.h" -#include "npc_ai.h" +#include "worldserver.h" extern WorldServer worldserver; diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index b55102072..620d2669c 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -15,26 +15,24 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" -#include "../common/spdat.h" -#include "masterentity.h" -#include "../common/packet_dump.h" -#include "../common/moremath.h" -#include "../common/item.h" -#include "worldserver.h" -#include "../common/skills.h" + #include "../common/bodytypes.h" #include "../common/classes.h" +#include "../common/debug.h" +#include "../common/item.h" #include "../common/rulesys.h" +#include "../common/skills.h" +#include "../common/spdat.h" +#include "quest_parser_collection.h" +#include "string_ids.h" +#include "worldserver.h" #include -#include + #ifndef WIN32 #include #include "../common/unix.h" #endif -#include "string_ids.h" -#include "quest_parser_collection.h" extern Zone* zone; extern volatile bool ZoneLoaded; From 34b19508207cd2a499d63cef98bc9854850646b4 Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 16:46:43 -0600 Subject: [PATCH 24/26] forage.cpp #include cleanup --- zone/forage.cpp | 68 ++++++++++--------------------------------------- 1 file changed, 13 insertions(+), 55 deletions(-) diff --git a/zone/forage.cpp b/zone/forage.cpp index d1008031a..cbb6550db 100644 --- a/zone/forage.cpp +++ b/zone/forage.cpp @@ -15,75 +15,33 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "../common/debug.h" -#include -#include -#include - -#ifdef _WINDOWS -#define snprintf _snprintf -#endif - -#include "forage.h" -#include "entity.h" -#include "masterentity.h" -#include "npc.h" -#include "water_map.h" -#include "titles.h" -#include "string_ids.h" #include "../common/misc_functions.h" -#include "../common/string_util.h" #include "../common/rulesys.h" +#include "../common/string_util.h" +#include "entity.h" +#include "forage.h" +#include "npc.h" +#include "quest_parser_collection.h" +#include "string_ids.h" +#include "titles.h" +#include "water_map.h" #include "zonedb.h" + +#include + #ifdef _WINDOWS #define snprintf _snprintf #endif -#include "quest_parser_collection.h" +struct NPCType; //max number of items which can be in the foraging table //for a given zone. #define FORAGE_ITEM_LIMIT 50 -/* - -The fishing and foraging need some work... -foraging currently gives each item an equal chance of dropping -fishing gives items which come in last from the select a very -very low chance of dropping. - - -Schema: -CREATE TABLE forage ( - id int(11) NOT NULL auto_increment, - zoneid int(4) NOT NULL default '0', - Itemid int(11) NOT NULL default '0', - level smallint(6) NOT NULL default '0', - chance smallint(6) NOT NULL default '0', - PRIMARY KEY (id) -) TYPE=MyISAM; - -old table upgrade: -alter table forage add chance smallint(6) NOT NULL default '0'; -update forage set chance=100; - - -CREATE TABLE fishing ( - id int(11) NOT NULL auto_increment, - zoneid int(4) NOT NULL default '0', - Itemid int(11) NOT NULL default '0', - skill_level smallint(6) NOT NULL default '0', - chance smallint(6) NOT NULL default '0', - npc_id int NOT NULL default 0, - npc_chance int NOT NULL default 0, - PRIMARY KEY (id) -) TYPE=MyISAM; - - -*/ - -// This allows EqEmu to have zone specific foraging - BoB uint32 ZoneDatabase::GetZoneForage(uint32 ZoneID, uint8 skill) { uint32 item[FORAGE_ITEM_LIMIT]; From 4a597a2b38869410ad25fdecb5a93f6ad4ab5996 Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 16:48:48 -0600 Subject: [PATCH 25/26] tradeskills.cpp #include cleanup --- zone/tradeskills.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index 82d84e5cf..fd9f5a632 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -24,17 +24,14 @@ #include //for htonl #endif -#include "masterentity.h" -#include "zonedb.h" -#include "../common/packet_functions.h" -#include "../common/packet_dump.h" -#include "titles.h" -#include "string_ids.h" #include "../common/misc_functions.h" -#include "../common/string_util.h" #include "../common/rulesys.h" -#include "quest_parser_collection.h" +#include "../common/string_util.h" #include "queryserv.h" +#include "quest_parser_collection.h" +#include "string_ids.h" +#include "titles.h" +#include "zonedb.h" extern QueryServ* QServ; From fde9517247ed1ffea4a019d137f928cdbcfe58ae Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 16:55:35 -0600 Subject: [PATCH 26/26] mob.cpp #include cleanup mob.h declarations mob.h #include cleanup --- zone/mob.cpp | 14 +++++++------- zone/mob.h | 13 ++++++++++--- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/zone/mob.cpp b/zone/mob.cpp index 35a019252..6772ff432 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -15,17 +15,17 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" -#include "masterentity.h" + #include "../common/spdat.h" -#include "string_ids.h" -#include "worldserver.h" -#include "quest_parser_collection.h" #include "../common/string_util.h" -#include -#include +#include "quest_parser_collection.h" +#include "string_ids.h" +#include "worldserver.h" + #include +#include +#include extern EntityList entity_list; diff --git a/zone/mob.h b/zone/mob.h index 944dfc515..55147ff7a 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -18,21 +18,28 @@ #ifndef MOB_H #define MOB_H -#include "../common/features.h" #include "common.h" #include "entity.h" #include "hate_list.h" #include "pathing.h" #include #include -#include char* strn0cpy(char* dest, const char* source, uint32 size); #define MAX_SPECIAL_ATTACK_PARAMS 8 class EGNode; -class MobFearState; +class Client; +class EQApplicationPacket; +class Group; +class ItemInst; +class NPC; +class Raid; +struct Item_Struct; +struct NewSpawn_Struct; +struct PlayerPositionUpdateServer_Struct; + class Mob : public Entity { public: enum CLIENT_CONN_STATUS { CLIENT_CONNECTING, CLIENT_CONNECTED, CLIENT_LINKDEAD,