Aller au contenu

Photo

Drop all items on death script


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
Cablefish

Cablefish
  • Members
  • 22 messages
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.

#2
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
Try axe's system . 

Axe Murderer's Killer Death System 1 v2.2 by Axe

#3
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
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 .


#4
Genisys

Genisys
  • Members
  • 525 messages

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 .