From 13f739d2eff07bbc8e8aad3335d15a44e4cea35c Mon Sep 17 00:00:00 2001 From: Kinglykrab Date: Wed, 11 Jun 2014 07:48:37 -0400 Subject: [PATCH] Decay Timer stuff. --- common/database.h | 13 ------------- zone/corpse.cpp | 6 +----- zone/net.cpp | 3 --- zone/zone.cpp | 30 ------------------------------ zone/zonedb.h | 1 - 5 files changed, 1 insertion(+), 52 deletions(-) diff --git a/common/database.h b/common/database.h index 300fc9875..1d389af64 100644 --- a/common/database.h +++ b/common/database.h @@ -74,19 +74,6 @@ 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 value[0]; diff --git a/zone/corpse.cpp b/zone/corpse.cpp index 2e8df83ec..d249117ec 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -15,11 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* -New class for handeling corpses and everything associated with them. -Child of the Mob class. --Quagmire -*/ + #include "../common/debug.h" #include #include diff --git a/zone/net.cpp b/zone/net.cpp index 15e108e42..125cab3cb 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -94,7 +94,6 @@ char errorname[32]; uint16 adverrornum = 0; extern Zone* zone; EQStreamFactory eqsf(ZoneStream); -npcDecayTimes_Struct npcCorpseDecayTimes[100]; TitleManager title_manager; DBAsyncFinishedQueue MTdbafq; DBAsync *dbasync = nullptr; @@ -252,8 +251,6 @@ int main(int argc, char** argv) { database.LoadAAEffects(); _log(ZONE__INIT, "Loading tributes"); database.LoadTributes(); - _log(ZONE__INIT, "Loading corpse timers"); - database.GetDecayTimes(npcCorpseDecayTimes); _log(ZONE__INIT, "Loading commands"); int retval=command_init(); if(retval<0) diff --git a/zone/zone.cpp b/zone/zone.cpp index 4124ba7d3..a74f8623a 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -1879,36 +1879,6 @@ bool Zone::RemoveSpawnGroup(uint32 in_id) { return false; } - -// Added By Hogie -bool ZoneDatabase::GetDecayTimes(npcDecayTimes_Struct* npcCorpseDecayTimes) { - char errbuf[MYSQL_ERRMSG_SIZE]; - char* query = 0; - int i = 0; - MYSQL_RES *result; - MYSQL_ROW row; - - if (RunQuery(query, MakeAnyLenString(&query, "SELECT varname, value FROM variables WHERE varname like 'decaytime%%' ORDER BY varname"), errbuf, &result)) { - safe_delete_array(query); - while((row = mysql_fetch_row(result))) { - Seperator sep(row[0]); - npcCorpseDecayTimes[i].minlvl = atoi(sep.arg[1]); - npcCorpseDecayTimes[i].maxlvl = atoi(sep.arg[2]); - if (atoi(row[1]) > 7200) - npcCorpseDecayTimes[i].seconds = 720; - else - npcCorpseDecayTimes[i].seconds = atoi(row[1]); - i++; - } - mysql_free_result(result); - } - else { - safe_delete_array(query); - return false; - } - return true; -}// Added By Hogie -- End - void Zone::weatherSend() { EQApplicationPacket* outapp = new EQApplicationPacket(OP_Weather, 8); diff --git a/zone/zonedb.h b/zone/zonedb.h index 32807a6e3..d1c20b921 100644 --- a/zone/zonedb.h +++ b/zone/zonedb.h @@ -259,7 +259,6 @@ public: /* * Corpses */ - bool GetDecayTimes(npcDecayTimes_Struct* npcCorpseDecayTimes); uint32 CreatePlayerCorpse(uint32 charid, const char* charname, uint32 zoneid, uint16 instanceid, uchar* data, uint32 datasize, float x, float y, float z, float heading); bool CreatePlayerCorpseBackup(uint32 dbid, uint32 charid, const char* charname, uint32 zoneid, uint16 instanceid, uchar* data, uint32 datasize, float x, float y, float z, float heading); uint32 UpdatePlayerCorpse(uint32 dbid, uint32 charid, const char* charname, uint32 zoneid, uint16 instanceid, uchar* data, uint32 datasize, float x, float y, float z, float heading, bool isRessurected = false);