Author Topic: Drop all items on death script  (Read 416 times)

Legacy_Cablefish

  • Newbie
  • *
  • Posts: 41
  • Karma: +0/-0
Drop all items on death script
« on: August 25, 2010, 10:17:28 am »


               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.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Drop all items on death script
« Reply #1 on: August 25, 2010, 09:15:11 pm »


               Try axe's system . 

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

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Drop all items on death script
« Reply #2 on: August 25, 2010, 09:25:14 pm »


               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.'<img'>

Hope that helps. Good luck.
               
               

               


                     Modifié par GhostOfGod, 25 août 2010 - 08:28 .
                     
                  


            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Drop all items on death script
« Reply #3 on: August 28, 2010, 03:52:08 am »


               

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 .