46 lines
990 B
Plaintext
46 lines
990 B
Plaintext
void main()
|
|
|
|
{
|
|
object oPC = GetPCSpeaker();
|
|
int antal = 5;
|
|
string tag = "Anoyspiritessen";
|
|
|
|
object oItem = GetFirstItemInInventory( oPC );
|
|
int count = 0;
|
|
int stackSize;
|
|
int i;
|
|
|
|
while(GetIsObjectValid(oItem) && count < antal)
|
|
{
|
|
// Check tag
|
|
if (GetTag(oItem) == tag)
|
|
{
|
|
stackSize = GetItemStackSize(oItem);
|
|
if(stackSize == 1)
|
|
{
|
|
DestroyObject(oItem);
|
|
}
|
|
else
|
|
{
|
|
for(i=0; i<stackSize; i++)
|
|
{
|
|
SetItemStackSize(oItem,GetItemStackSize(oItem)-1);
|
|
count+=1;
|
|
if(count == antal)
|
|
{
|
|
return;
|
|
}
|
|
}
|
|
// Take care of last one.
|
|
DestroyObject(oItem);
|
|
}
|
|
}
|
|
oItem = GetNextItemInInventory(oPC);
|
|
}
|
|
return;
|
|
|
|
AssignCommand(oPC, TakeGoldFromCreature(100000, oPC, TRUE));
|
|
|
|
|
|
}
|