PDA

View Full Version : Adjustable Corpse Decay Timer Script


trevius
08-11-2008, 04:34 AM
It took me a while to figure out how to make this work, but now it works like a charm as far as I have tested. This will allow you to adjust decay timers per NPC. This is mainly useful in cases where an NPC would normally have no loot at all. I will be using it in my experience only zone as well as on any quest spawned adds that have no loot. It should reduce client lag as well as maybe help server load slightly.

#Adjustable Corpse Decay Timer Script
#Decay Timer Is in Milliseconds
#This will only work on Empty corpses

my $entity_id;

sub EVENT_SPAWN {

$entity_id=$npc->GetID();

}

sub EVENT_DEATH {

my $corpse_id = $entity_list->GetCorpseByID($entity_id);

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

}

This could possibly even be used in the global quest file, but I think it would be better if we can get something that does this added directly into the source. It would be awesome to have a rule to set globally for decay timers on empty corpses.

Please give feedback on this script if you try it and find that there are any issues with it.

trevius
08-11-2008, 07:30 AM
Pre-mature posting I guess lol. This quest works, but it currently only works for 1 NPC at a time. I am still working to make it so that it can be used in any scenario. Here is the thread where it is being worked on:

http://www.eqemulator.net/forums/showthread.php?t=25900

Once the quest is completed and tested enough to be considered complete, I will post the end result here in this thread.