EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Custom (https://www.eqemulator.org/forums/forumdisplay.php?f=671)
-   -   Adjustable Corpse Decay Timer Script (https://www.eqemulator.org/forums/showthread.php?t=25927)

trevius 08-11-2008 04:34 AM

Adjustable Corpse Decay Timer Script
 
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.

Code:

#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.


All times are GMT -4. The time now is 02:55 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.