GetDamageDealtByType() and GetHasEffect() are not what you looking for.
- GetDamageDealtByType() can be used in creature's OnDamaged event to get the amount of damage dealt by the specified type.
- GetHasEffect() doesn't work for you either, because what you have is not an effect.
What you need to check for are item properties.
If I remember correctly alchemist fire is 1d4 Fire Damage + VisualEffect. The ItemPropertyDamageBonus() works this way: 1d6 and above have a built-in VFX. For 1d4 and below, if you want a visual effect you have to apply an ItemPropertyVisualEffect(ITEM_VISUAL_FIRE) yourself. That's what the spell scripts do. So what you want to know is whether ItemPropertyDamageBonus() or ItemPropertyVisualEffect() are present on the item. ItemPropertyDamageBonus() should be enough though.
The easiest solution is to use:
int IPGetItemHasProperty(
object oItem,
itemproperty ipCompareTo,
int nDurationType,
int bIgnoreSubType = FALSE
);
You'll need to include "x2_inc_itemprop". It will search for the item property ipCompareTo (which you need to create or get from another item) on oItem.
#include "x2_inc_itemprop"
int checkItem(object oItem)
{
// I'm not sure if this is correct.
// Check the alchemist fire scripts for the correct property
ipCompareTo = ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_FIRE,
IP_CONST_DAMAGEBONUS_1d4);
return IPGetItemHasProperty(oItem,
ipCompareTo,
DURATION_TYPE_TEMPORARY,
FALSE);
}
This will tell you if the item has a temporary item property with 1d4 fire damage. This should be alchemists fire. The spells Darkfire and Flameweapon do 1d6, so no worries there. If a custom weapon deals 1d4 the duration is permanent, so that wouldn't count either. But I don't know your module, there could be other source of temporary 1d4 fire damage.