mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-11 05:32:23 +00:00
Decay Timer stuff.
This commit is contained in:
parent
6e5e450054
commit
13f739d2ef
@ -74,19 +74,6 @@ uint8 eventid;
|
|||||||
EventLogDetails_Struct eld[255];
|
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 {
|
struct VarCache_Struct {
|
||||||
char varname[26]; // varname is char(25) in database
|
char varname[26]; // varname is char(25) in database
|
||||||
char value[0];
|
char value[0];
|
||||||
|
|||||||
@ -15,11 +15,7 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
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 "../common/debug.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
@ -94,7 +94,6 @@ char errorname[32];
|
|||||||
uint16 adverrornum = 0;
|
uint16 adverrornum = 0;
|
||||||
extern Zone* zone;
|
extern Zone* zone;
|
||||||
EQStreamFactory eqsf(ZoneStream);
|
EQStreamFactory eqsf(ZoneStream);
|
||||||
npcDecayTimes_Struct npcCorpseDecayTimes[100];
|
|
||||||
TitleManager title_manager;
|
TitleManager title_manager;
|
||||||
DBAsyncFinishedQueue MTdbafq;
|
DBAsyncFinishedQueue MTdbafq;
|
||||||
DBAsync *dbasync = nullptr;
|
DBAsync *dbasync = nullptr;
|
||||||
@ -252,8 +251,6 @@ int main(int argc, char** argv) {
|
|||||||
database.LoadAAEffects();
|
database.LoadAAEffects();
|
||||||
_log(ZONE__INIT, "Loading tributes");
|
_log(ZONE__INIT, "Loading tributes");
|
||||||
database.LoadTributes();
|
database.LoadTributes();
|
||||||
_log(ZONE__INIT, "Loading corpse timers");
|
|
||||||
database.GetDecayTimes(npcCorpseDecayTimes);
|
|
||||||
_log(ZONE__INIT, "Loading commands");
|
_log(ZONE__INIT, "Loading commands");
|
||||||
int retval=command_init();
|
int retval=command_init();
|
||||||
if(retval<0)
|
if(retval<0)
|
||||||
|
|||||||
@ -1879,36 +1879,6 @@ bool Zone::RemoveSpawnGroup(uint32 in_id) {
|
|||||||
return false;
|
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()
|
void Zone::weatherSend()
|
||||||
{
|
{
|
||||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_Weather, 8);
|
EQApplicationPacket* outapp = new EQApplicationPacket(OP_Weather, 8);
|
||||||
|
|||||||
@ -259,7 +259,6 @@ public:
|
|||||||
/*
|
/*
|
||||||
* Corpses
|
* 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);
|
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);
|
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);
|
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);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user