Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-12-2008, 02:28 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default Empty Corpse Decay Timer with Rule

This code still needs most of the important code to be written, but I don't think it will be anything too complex to finish. The Required SQL and Rule is easy enough to set, and are posted below. But, the actual part where the NPC dies and checks if the corpse is empty or not is not yet done. I am pretty sure that it needs to be added to the section of the PlayerCorpse.cpp posted below.

Required SQL:
Code:
Insert into rule_values values (0, 'npc:EmptyCorpseDecayTime', -1);

\common\ruletypes.h:
Code:
RULE_INT ( NPC, EmptyCorpseDecayTime, -1 ) //Sets the Decay Time for Empty NPC Corpses in Seconds. Default value: -1 (feature disabled)
----Below is where the work needs to be done to get this code finished----

And, something like this from a quest script I made:

Code:
  if ($corpse_id->IsEmpty()) {
    my $corpse_decay = $corpse_id->CastToCorpse();
    $corpse_decay->SetDecayTimer(5000); }

Needs to be added as a rule into the PlayerCorpse.cpp in this section:
PlayerCorpse.cpp:

Code:
// To be used on NPC death and ZoneStateLoad
// Mongrel: added see_invis and see_invis_undead
Corpse::Corpse(NPC* in_npc, ItemList* in_itemlist, int32 in_npctypeid, const NPCType** in_npctypedata, int32 in_decaytime)
// vesuvias - appearence fix
 : Mob("Unnamed_Corpse","",0,0,in_npc->GetGender(),in_npc->GetRace(),in_npc->GetClass(),BT_Humanoid//bodytype added
       ,in_npc->GetDeity(),in_npc->GetLevel(),in_npc->GetNPCTypeID(),in_npc->GetSize(),0,
	 in_npc->GetHeading(),in_npc->GetX(),in_npc->GetY(),in_npc->GetZ(),0,
	 in_npc->GetTexture(),in_npc->GetHelmTexture(),
	 0,0,0,0,0,0,0,0,0,
	 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0,0,0,0,0,0,0),
	corpse_decay_timer(in_decaytime),
	corpse_delay_timer(in_decaytime/2),
	corpse_graveyard_timer(0)
{
	corpse_graveyard_timer.Disable();
	memset(item_tint, 0, sizeof(item_tint));
	pIsChanged = false;
	p_PlayerCorpse = false;
	pLocked = false;
	BeingLootedBy = 0xFFFFFFFF;
	if (in_itemlist) {
		itemlist = *in_itemlist;
		in_itemlist->clear();
	}
	
	SetCash(in_npc->GetCopper(), in_npc->GetSilver(), in_npc->GetGold(), in_npc->GetPlatinum());
	
	npctype_id = in_npctypeid;
	SetPKItem(0);
	charid = 0;
	dbid = 0;
	p_depop = false;
	strcpy(orgname, in_npc->GetName());
	strcpy(name, in_npc->GetName());
	// Added By Hogie 
	for(int count = 0; count < 100; count++) {
		if ((level >= npcCorpseDecayTimes[count].minlvl) && (level <= npcCorpseDecayTimes[count].maxlvl)) {
			corpse_decay_timer.SetTimer(npcCorpseDecayTimes[count].seconds*1000);
			break;
		}
	}
	// Added By Hogie -- End
	for (int i=0; i<MAX_LOOTERS; i++)
		looters[i] = 0;
	this->rezzexp = 0;
}
So, basically it should be:

NPC Dies
If Rule EmptyCorpseDecayTime >= 0
If Corpse is empty
Set the decay timer in seconds to the integer that the rule is set to
Continue other steps in the NPC death process

My coding skills are still very weak, so the only way I can get this completed is with help or by searching the source for similar examples of what I want to do. What I have done so far is barely anything, but I don't think the rest would be too bad if I only knew code lol. I will definitely continue to work on getting this done, but if anyone else has any input, it would be greatly appreciated
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 08-12-2008 at 10:32 AM..
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 01:14 PM.


 

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