jdoran
10-29-2013, 08:59 PM
Hello again. Back in February I asked about this, but was focused more on the appearances than function.
What I would like is a lootable body that doesn't despawn until I explicitly tell it to. This is sort of like a ground-spawn container.
I've gotten around to implementing some of these ideas, and am stumped once again at this. The idea is that a player enters a zone and the corpse spawns. The player eventually runs across it, and is able to loot some item on the body (let's say a note).
If I create a regular corpse it might decay before the player saw it. If I call the Kill() method on the NPC, then the player gets no credit for the kill, and the corpse decays immediately. I have made sure that the NPC had
an item in its inventory hoping that it wouldn't be considered empty.
The corpse is gone before I can call SetDecayTimer().
I have tried to emulate NPC::Death and create a new corpse that way, but the corpse never appears (visually) in the zone. I can look it up on the entity list. Items are transferred from the original NPC to the corpse.
If I create a mob that appears dead, then I don't see how anyone could loot it. So I'm focusing on corpses for the moment.
Does anyone have any good ideas for me to try?
What I would like is a lootable body that doesn't despawn until I explicitly tell it to. This is sort of like a ground-spawn container.
I've gotten around to implementing some of these ideas, and am stumped once again at this. The idea is that a player enters a zone and the corpse spawns. The player eventually runs across it, and is able to loot some item on the body (let's say a note).
If I create a regular corpse it might decay before the player saw it. If I call the Kill() method on the NPC, then the player gets no credit for the kill, and the corpse decays immediately. I have made sure that the NPC had
an item in its inventory hoping that it wouldn't be considered empty.
The corpse is gone before I can call SetDecayTimer().
I have tried to emulate NPC::Death and create a new corpse that way, but the corpse never appears (visually) in the zone. I can look it up on the entity list. Items are transferred from the original NPC to the corpse.
If I create a mob that appears dead, then I don't see how anyone could loot it. So I'm focusing on corpses for the moment.
Does anyone have any good ideas for me to try?