void DestroyFireImmuneItems(object oPC)
{
int nSlot = INVENTORY_SLOT_HEAD;
object oItem;
itemproperty ip;
for(nSlot; nSlot < NUM_INVENTORY_SLOTS; Slot++)
{
oItem = GetItemInSlot(nSlot, oPC);
if(oItem != OBJECT_INVALID)
{
ip = GetFirstItemProperty(oItem);
while(GetIsItemPropertyValid(ip))
{
switch(GetItemPropertyType(ip))
{
case ITEM_PROPERTY_DAMAGE_RESISTANCE:
case ITEM_PROPERTY_IMMUNITY_DAMAGE_TYPE:
if(GetItemPropertySubType(ip) == IP_CONST_DAMAGETYPE_FIRE)
{
DestroyObject(oItem);
break;
}
}
ip = GetNextItemProperty(oItem);
}
}
}
}
This should do it, rename the function if needed. (Fingers crossed, I sincerely hope ShaDoOoW won't tell me this is totally wrong and unreadable, except if it is lol)
Kato
Modifié par Kato_Yang, 14 juillet 2012 - 06:33 .