/// /// /// /// /// /// /// /// /// /// /// ///
/// wg_used
/// OnDeath script for witchgrass placeable.
/// If fire destroyed the plant, it burns.
///
/// Created by Gilgon Avalrock
/// /// /// /// /// /// /// /// /// /// /// ///
#include "lib_witchgrass"
void main()
{
    //check for fire damage
    if(GetDamageDealtByType(DAMAGE_TYPE_FIRE)>0){
        //create smoke effects
        GenerateSmoke(OBJECT_SELF);
        object Smoke = CreateObject(OBJECT_TYPE_PLACEABLE,"plc_dustplume", GetLocation(OBJECT_SELF));
        DestroyObject(Smoke,6.f);
        int i=1;
        //get every creature within 10 feet high.
        object oCreature = GetNearestObject( OBJECT_TYPE_CREATURE, OBJECT_SELF, i );
        while( oCreature != OBJECT_INVALID && GetDistanceToObject( oCreature ) <= 10.f ) {
            GetHigh(oCreature);
            i++;
            oCreature = GetNearestObject( OBJECT_TYPE_CREATURE, OBJECT_SELF, i );
        }
        //nothing survives the fire...
        DestroyInventory(OBJECT_SELF);
    }
}