nice thread. I was hoping to get a little help with a script that I thought worked already with my module when I had Sherincall create the base mod for me but it has never worked. I need a script/script system so that when Players die they drop all of their gold into a sack and ALSO have a 20% chance to drop 1 randomly selected equipped item EXCEPT for plot items.
I'm not sure if this 'chance' is even possibly or the randomly selected equipment slot either. Much love if you could figure it out for me
'>
this is what the script currently has in it, but again it never seemed to work:
object oVault = GetLocalObject(GetModule(), "TM_Vault");
int nDropLevel = GetLocalInt(oVault, "TM_PCDropLevel");
int bPVP = GetIsPC(GetLastHostileActor(oPC));
if (d100() < TM_PERCENT_ITEM_DROP_ON_PC_DEATH && nDropLevel != DEATH_DROP_NONE)
{
if (nDropLevel == DEATH_DROP_PVE && !bPVP)
{
int nSlot = Random(NUM_INVENTORY_SLOTS);
object oItem = GetItemInSlot(nSlot, oPC);
while (oItem == OBJECT_INVALID)
{
nSlot++;
if (nSlot > NUM_INVENTORY_SLOTS-1) nSlot = 0;
oItem = GetItemInSlot(nSlot, oPC);
}
location lLoc = GetLocation(oLootBag);
CopyObject(oItem, lLoc, oLootBag);
DestroyObject(oItem);
}
}
AssignCommand(oLootBag, TakeGoldFromCreature(GetGold(oPC), oPC));
Modifié par Vhaeraun Baenre, 27 novembre 2010 - 02:30 .