else if (DateTime.UtcNow >= (m_TimeOfDeath + m_Map.CorpseDecayTime))
{
Delete();
return;
}
else
{
int decayTime = m_Map.CorpseDecayTime; // get the default decay time for the map
// Change corpse decay time for specific regions
string regionName = m_Map.GetRegionName(m_Location);
if (regionName == "YourRegionNameHere")
{
decayTime = 60; // set the decay time to 60 seconds (1 minute)
}
if (DateTime.UtcNow >= (m_TimeOfDeath + TimeSpan.FromSeconds(decayTime)))
{
Delete();
return;
}
}
private TimeSpan GetDecayTime()
{
if(m_Owner is BaseCreature && ((BaseCreature)m_Owner).IsChampionSpawn && !(m_Owner is BaseChampion))
{
return TimeSpan.FromSeconds(10);
}
else if(m_Owner is BaseCreature && !(m_Owner is [special boss type here]) && m_Owner.Region.IsPartOf("[name of region here]"))
{
return TimeSpan.FromSeconds(15);
}
else
{
return m_BoneDecayTime;
}
}
BeginDecay(GetDecayTime());
DevourCorpse();
if (owner is PlayerMobile)
{
if (PlayerCorpses == null)
PlayerCorpses = new Dictionary<Corpse, int>();
PlayerCorpses[this] = 0;
}
public void TurnToBones()
{
if (Deleted)
{
return;
}
ProcessDelta();
SendRemovePacket();
ItemID = Utility.Random(0xECA, 9); // bone graphic
Hue = 0;
ProcessDelta();
SetFlag(CorpseFlag.NoBones, true);
SetFlag(CorpseFlag.IsBones, true);
BeginDecay(GetDecayTime());
}
We use essential cookies to make this site work, and optional cookies to enhance your experience.