Decay Timer stuff.

This commit is contained in:
Kinglykrab 2014-06-11 07:48:37 -04:00
parent 6e5e450054
commit 13f739d2ef
5 changed files with 1 additions and 52 deletions

View File

@ -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];

View File

@ -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 <stdlib.h>
#include <stdio.h>

View File

@ -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)

View File

@ -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);

View File

@ -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);