Drop all items on death script
#1
Posté 25 août 2010 - 09:17
What i need is a death script that'll take ALL the characters items (except plot items) and place them on a Headstone for other players to loot.
Bonus: It would be really neat if a Head of the player and maybe an ear would drop too but thats not important right now.
#2
Posté 25 août 2010 - 08:15
#3
Posté 25 août 2010 - 08:25
//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 .
#4
Posté 28 août 2010 - 02:52
Cablefish wrote...
I've been searching the old Bioware forums and manually browsing the five pages of threads on these forums to find what i'm looking for.
What i need is a death script that'll take ALL the characters items (except plot items) and place them on a Headstone for other players to loot.
Bonus: It would be really neat if a Head of the player and maybe an ear would drop too but thats not important right now.
Wow, sounds like your planning on some serious PC ownage here...
I wonder how long your player base will last... >.> (*whistles innocently*)
Modifié par Genisys, 28 août 2010 - 07:16 .





Retour en haut






