I am assuming that this will also create the tombstone at the players location of death. If different let me know but perhaps something like this?
//Goes OnPlayerDeath of the module properties
void main()
{
object oPC = GetLastPlayerDied();
if (!GetIsPC(oPC)) return;
location lPC = GetLocation(oPC);
object oTombstone = CreateObject(OBJECT_TYPE_PLACEABLE, "res ref gos here", lPC);
object oItem = GetFirstItemInInventory(oPC);
while (GetIsObjectValid(oItem))
{
if (GetPlotFlag(oItem) != TRUE)
{
AssignCommand(oTombstone, ActionTakeItem(oItem, oPC));
}
oItem = GetNextItemInInventory(oPC);
}
int nInt;
for (nInt=0; nInt<NUM_INVENTORY_SLOTS; nInt++)
{
oItem = GetItemInSlot(nInt, oPC);
if (GetIsObjectValid(oItem) && GetPlotFlag(oItem) != TRUE)
AssignCommand(oTombstone, ActionTakeItem(oItem, oPC));
}
//This line takes the gold as well.
AssignCommand(oTombstone, TakeGoldFromCreature(GetGold(oPC), oPC));
//These lines put a head in the tombstone and add the players name to it.
object oHead = CreateItemOnObject("res ref of head", oTombstone);
string sPCName = GetName(oPC);
SetName(oHead, "The Head of " + sPCName);
}
This gos in the OnPlayerDeath event of your module. Be sure to plug in the 2 "res refs" where its says "res ref gos here". The first one is for the tombstone object and the second for the head item.
So this script will create a tombstone at the players location. Take all non-plot items from player and put them in the tombstone, and will add a head in the inventory of the tombstone that will be named "The Head of
??".
I haven't tested but it should work if my brain is working today.
'>
Hope that helps. Good luck.
Modifié par GhostOfGod, 25 août 2010 - 08:28 .