Well I don't want the item to drop if GetItemCursedFlag/GetPlotFlag is TRUE.
This is how your modified script looks. There's probably a much better way to do it cuz I'm not a great scripter, lol.
#include "x0_i0_position"
void main()
{
object oPC = GetLastPlayerDied();
int nCount;
object oItem;
if (!nCount)
{
oItem = GetFirstItemInInventory (oPC);
while (GetIsObjectValid (oItem))
{
nCount ++;
oItem = GetNextItemInInventory (oPC);
}
}
int nItem = Random (nCount) + 1;
int nContinue = TRUE;
int nCounter = 1;
oItem = GetFirstItemInInventory (oPC);
while (GetIsObjectValid (oItem) && nContinue)
{
if (GetItemCursedFlag(oItem) == TRUE)
{
oItem = GetNextItemInInventory(oPC);
}
else if (GetPlotFlag(oItem) == TRUE)
{
oItem = GetNextItemInInventory(oPC);
}
else if (nCounter == nItem)
{
{
CopyObject (oItem, GetRandomLocation (GetArea(oPC), oPC, 2.0));
DestroyObject (oItem, 0.1);
nContinue = FALSE;
}
nCounter ++;
oItem = GetNextItemInInventory (oPC);
}
}
}
Modifié par mwplayer, 24 juin 2011 - 10:18 .