Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-09-2009, 08:49 AM
tsowl
Fire Beetle
 
Join Date: Jul 2004
Posts: 8
Default load player corpse decay time

zone/client_packet.cpp
Code:
			sec = (ttime/1000)%60; // Total seconds
			min = (ttime/60000)%60; // Total seconds
-			hour = (ttime/3600000)%60; // Total hours
-			day = (ttime/86400000)%24; // Total Days
+			hour = (ttime/3600000)%24; // Total hours
+			day = ttime/86400000; // Total Days
zone/playercorpse.cpp
Code:
	dbid = in_dbid;
	p_depop = false;
	charid = in_charid;
	itemlist = *in_itemlist;
	in_itemlist->clear();

	//we really should be loading the decay timer here...
+	LoadPlayerCorpseDecayTime(in_dbid);
	
	strcpy(orgname, in_charname);
	strcpy(name, in_charname);
add:
Code:
void Corpse::LoadPlayerCorpseDecayTime(int32 dbid){
	if(!dbid)
		return;
	char errbuf[MYSQL_ERRMSG_SIZE];
    char *query = 0;
    MYSQL_RES *result;
    MYSQL_ROW row;
	if (database.RunQuery(query, MakeAnyLenString(&query, "SELECT (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(timeofdeath)) FROM player_corpses WHERE id=%d and not timeofdeath=0", dbid), errbuf, &result)) {
		safe_delete_array(query);
		while (row = mysql_fetch_row(result)) {
			if(atoi(row[0]) > 0 && RuleI(Character, CorpseDecayTimeMS) > (atoi(row[0]) * 1000))
				corpse_decay_timer.SetTimer(RuleI(Character, CorpseDecayTimeMS) - (atoi(row[0]) * 1000));
			else
				corpse_decay_timer.SetTimer(5000);
		}
		mysql_free_result(result);
	}
	safe_delete_array(query);
}
zone/playercorpse.h
Code:
class Corpse : public Mob
{
public:
+	void LoadPlayerCorpseDecayTime(int32 dbid);
}
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 05:18 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3