/// /// /// /// /// /// /// /// /// /// /// ///
/// witchseeds
/// OnActivateItem script for witchgrass seeds.
/// Will create a new witchgrass plant wherever activated.
/// You can limit the areas that new plants will grow
/// by uncommenting the 4 lines below, and changing the
/// names to the tags of the areas in your mod.
///
/// Created by Gilgon Avalrock
/// /// /// /// /// /// /// /// /// /// /// ///
#include "lib_witchgrass"
void main()
{
    object oMaster = GetItemActivator();
    object oItem = GetItemActivated();
    location lLoc = GetItemActivatedTargetLocation();
    if(GetIsObjectValid(oItem))
    {
        if(GetIsObjectValid(oMaster))
        {
            string sAreaTag = GetTag(GetArea(oMaster));
            if (sAreaTag == "Drylands" || sAreaTag == "Ayla" || sAreaTag == "Not Defined" || sAreaTag == "Not Defined Either"){
                AssignCommand(oMaster,ClearAllActions());
                AssignCommand(oMaster,ActionMoveToLocation(lLoc,TRUE));
                DelayCommand(3.f,CreateNewPlant(oMaster));
                DestroyObject(oItem,3.f);
            }else{
                AssignCommand(oMaster,ActionSpeakString("You can't plant Witch Grass in this area."));
            }
        }
    }
}