Full Version : Having monsters die w/out leaving a corpse
xmlspawner >>Q&A >>Having monsters die w/out leaving a corpse


<< Prev | Next >>

CUWhenUGetThere- 10-19-2006
Hello,

I couldn't find an answer via the search, so I'll ask here.

I am trying to make a champ similar spawn, and it will just lag everyone too much if i have 300+ corpses in a small area.

so, Is it possible to spawn monsters that will not leave a corpse after they die?
Or is there a setting within the spawner i could set so on the next spawn the corpses of all monsters in range will be deleted?

Thanks,

CU

ArteGordon- 10-19-2006
you can use the XmlDeathAction attachment to automatically delete corpses on death.


For example,

harpy/ATTACH/<xmldeathaction/action/@SETONTHIS/DELETE>

will spawn a harpy, and when it is killed it will not leave a corpse.

Another option is to add support for variable corpse decay time. In corpse.cs around line 385 at the end of the Corpse constructor you could make this mod

QUOTE

            if (!addToAggressors)
            {
                BaseCreature bc = (BaseCreature)owner;

                Mobile master = bc.GetMaster();
                if (master != null)
                    m_Aggressors.Add(master);

                List<DamageStore> rights = BaseCreature.GetLootingRights(bc.DamageEntries, bc.HitsMax);
                for (int i = 0; i < rights.Count; ++i)
                {
                    DamageStore ds = rights[i];

                    if (ds.m_HasRight)
                        m_Aggressors.Add(ds.m_Mobile);
                }
            }

            // ARTEGORDONMOD
            // attachment support for variable corpse decay time
            XmlValue decayattach = (XmlValue)XmlAttach.FindAttachment(owner, typeof(XmlValue), "Decay");
            if (decayattach != null)
            {
                BeginDecay(TimeSpan.FromSeconds(decayattach.Value));
            }
            else
            {
                BeginDecay(m_DefaultDecayTime);
            }

        }


and then you could spawn things with variable corpse decay times by adding an XmlValue attachment named "Decay" along with the specified corpse decay time like this

harpy/ATTACH/xmlvalue,Decay,10

which would specify that the harpy corpse should decay after 10 seconds.
Normal creatures without the attachment will have their corpses decay with the default decay time as usual.

and you could get instant decay with

harpy/ATTACH/xmlvalue,Decay,0

CUWhenUGetThere- 10-19-2006
thank you arte. i keep forgetting about the attachments :/

edit: doesn't work.... maybe because i placed the spawn in green acres?
edit2: no, doesn't work anywhere....

maybe something wasn't installed right...?