OnItemActivated script help

Trying to get a grenade like bomb to do some damage to undead and a chance to turn the undead as well. Any help is appreciated. :slight_smile: As it stands right now, she goes through the motion of throwing a grenade, but nothing happens. I don’t see the grenade nor do the effects work. I’m out of my league here.

object oUsed = GetItemActivated();
if (GetTag(oUsed) == “BONE_BOMB”)
{
object oPC = GetItemActivator();
location lLoc = GetSpellTargetLocation();

   effect eTurned = EffectTurned();
   effect eBombFX = EffectVisualEffect(VFX_FNF_MYSTICAL_EXPLOSION);

    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eBombFX, lLoc);
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eTurned, GetSpellTargetObject());

OK. I think I’m heading in the right direction. Some of the effects work now and the skeleton target was turned properly…

object oUsed = GetItemActivated();
if (GetTag(oUsed) == “BONE_BOMB”)
{
object oPC = GetItemActivator();

   location lLoc = GetItemActivatedTargetLocation();

   object oItemActivate = GetItemActivatedTarget();


   effect eTurned = EffectTurned();
   effect eBombFX = EffectVisualEffect(VFX_FNF_MYSTICAL_EXPLOSION);

   ApplyEffectToObject(DURATION_TYPE_INSTANT, eBombFX, oItemActivate);
   ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eTurned, GetItemActivatedTarget(), 10.0);

   effect eDamage = EffectDamage(d6(), DAMAGE_TYPE_FIRE, DAMAGE_POWER_NORMAL);
   effect eHurt = EffectVisualEffect(VFX_COM_HIT_FIRE);
   ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oItemActivate);
   ApplyEffectToObject(DURATION_TYPE_INSTANT, eHurt, oItemActivate);
   }

}

TurnUndead is a little more complicated that just applying the effect of turning. So I lifted the vanilla script from “nw_s2_turndead” and edited it a little. I made the level of the bomb 6. You can change those numbers at the top if you wish. I also made it not effect other things, like planars. I think in that section, you can change the number for bonus turning types to 1 or TRUE.
Truth-be-told - this compiled, but I have not tried it out. If I get a chance, I will run it. Oh, I also put in the DoGrenade function which targets an area. This is from the Fire or Acid bomb script.

Edit - I was able to test my original attempt and fixed a pile of errors. The below worked and provides feedback when something is turned. This would be saved as the tag-based “bone_bomb” script.

#include "x2_inc_switches"
#include "x0_i0_spells"
void TurnUndead(object oPC, location lLoc)
{
    //SendMessageToPC(oPC, "Turning Undead with Bone Bomb");
    int nTotalLevel =  6;//GetHitDice(OBJECT_SELF);

    int nTurnLevel = 6;//nClericLevel;
    int nClassLevel = 6;//nClericLevel;
    int nTurnCheck = d20();//
    //SendMessageToPC(oPC, "nTurnCheck = "+IntToString(nTurnCheck));
    int nTurnHD = d6(2);

    //Flags for bonus turning types
    int nElemental = 0;//GetHasFeat(FEAT_AIR_DOMAIN_POWER) + GetHasFeat(FEAT_EARTH_DOMAIN_POWER) + GetHasFeat(FEAT_FIRE_DOMAIN_POWER) + GetHasFeat(FEAT_WATER_DOMAIN_POWER);
    int nVermin = 0;//GetHasFeat(FEAT_PLANT_DOMAIN_POWER);// + GetHasFeat(FEAT_ANIMAL_COMPANION);
    int nConstructs = 0;//GetHasFeat(FEAT_DESTRUCTION_DOMAIN_POWER);
    int nGoodOrEvilDomain =  0;//GetHasFeat(FEAT_GOOD_DOMAIN_POWER) + GetHasFeat(FEAT_EVIL_DOMAIN_POWER);
    int nPlanar = 0;//GetHasFeat(854);

    //Determine the maximum HD of the undead that can be turned.
    if(nTurnCheck <= 0)
    {
        nTurnLevel -= 4;
    }
    else if(nTurnCheck >= 1 && nTurnCheck <= 3)
    {
        nTurnLevel -= 3;
    }
    else if(nTurnCheck >= 4 && nTurnCheck <= 6)
    {
        nTurnLevel -= 2;
    }
    else if(nTurnCheck >= 7 && nTurnCheck <= 9)
    {
        nTurnLevel -= 1;
    }
    else if(nTurnCheck >= 10 && nTurnCheck <= 12)
    {
        //Stays the same
    }
    else if(nTurnCheck >= 13 && nTurnCheck <= 15)
    {
        nTurnLevel += 1;
    }
    else if(nTurnCheck >= 16 && nTurnCheck <= 18)
    {
        nTurnLevel += 2;
    }
    else if(nTurnCheck >= 19 && nTurnCheck <= 21)
    {
        nTurnLevel += 3;
    }
    else if(nTurnCheck >= 22)
    {
        nTurnLevel += 4;
    }
    //SendMessageToPC(oPC, "nTurnLevel = "+IntToString(nTurnLevel));
    //Gets all creatures in a 20m radius around the caster and turns them or not.  If the creatures
    //HD are 1/2 or less of the nClassLevel then the creature is destroyed.
    int nCnt = 1;
    int nHD, nRacial, nHDCount, bValid, nDamage;
    nHDCount = 0;
    effect eVis = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
    effect eVisTurn = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR);
    effect eDamage;
    effect eTurned = EffectTurned();
    effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
    effect eLink = EffectLinkEffects(eVisTurn, eTurned);
    eLink = EffectLinkEffects(eLink, eDur);

    effect eDeath = SupernaturalEffect(EffectDeath(TRUE));

    effect eImpactVis = EffectVisualEffect(VFX_FNF_LOS_HOLY_30);
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpactVis, GetLocation(OBJECT_SELF));

    //Get nearest enemy within 10m (30ft)
    object oBoom = CreateObject(OBJECT_TYPE_WAYPOINT, "nw_waypoint001", lLoc);
    object oTarget = GetNearestCreature(CREATURE_TYPE_IS_ALIVE, TRUE , oBoom, nCnt,CREATURE_TYPE_PERCEPTION , PERCEPTION_SEEN);
    while(GetIsObjectValid(oTarget) && nHDCount < nTurnHD && GetDistanceToObject(oTarget) <= 10.0)
    {
        //SendMessageToPC(oPC, GetName(oTarget)+" attempted to be turned.");
        if(!GetIsFriend(oTarget))
        {
            nRacial = GetRacialType(oTarget);


            if (nRacial == RACIAL_TYPE_OUTSIDER )
            {
                if (nPlanar)
                {
                     //Planar turning decreases spell resistance against turning by 1/2
                     nHD = GetHitDice(oTarget) + (GetSpellResistance(oTarget) /2) + GetTurnResistanceHD(oTarget);
                }
                else
                {
                    nHD = GetHitDice(oTarget) + (GetSpellResistance(oTarget) + GetTurnResistanceHD(oTarget) );
                }
            }
            else //(full turn resistance)
            {
                  nHD = GetHitDice(oTarget) + GetTurnResistanceHD(oTarget);
            }

            if(nHD <= nTurnLevel && nHD <= (nTurnHD - nHDCount))
            {
                //Check the various domain turning types
                if(nRacial == RACIAL_TYPE_UNDEAD)
                {
                    bValid = TRUE;
                }
                else if (nRacial == RACIAL_TYPE_VERMIN && nVermin > 0)
                {
                    bValid = TRUE;
                }
                else if (nRacial == RACIAL_TYPE_ELEMENTAL && nElemental > 0)
                {
                    bValid = TRUE;
                }
                else if (nRacial == RACIAL_TYPE_CONSTRUCT && nConstructs > 0)
                {
                    SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_TURN_UNDEAD));
                    nDamage = d3(nTurnLevel);
                    eDamage = EffectDamage(nDamage, DAMAGE_TYPE_MAGICAL);
                    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
                    DelayCommand(0.01, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget));
                    nHDCount += nHD;
                }
                else if (nRacial == RACIAL_TYPE_OUTSIDER && (nGoodOrEvilDomain+nPlanar > 0) )
                {
                    bValid = TRUE;
                }
                // * if wearing gauntlets of the lich,then can be turned
                else if (GetIsObjectValid(GetItemPossessedBy(oTarget, "x2_gauntletlich")) == TRUE)
                {
                    if (GetTag(GetItemInSlot(INVENTORY_SLOT_ARMS)) == "x2_gauntletlich")
                    {
                        bValid = TRUE;
                    }
                }

                //Apply results of the turn
                if( bValid == TRUE)
                {
                    SendMessageToPC(oPC, GetName(oTarget)+" was turned by the bomb!");
                    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);

                    if (nPlanar>0 && nRacial == RACIAL_TYPE_OUTSIDER)
                    {
                        effect ePlane = EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_HOLY);
                        ApplyEffectToObject(DURATION_TYPE_INSTANT, ePlane, oTarget);
                    }
                    //if(IntToFloat(nClassLevel)/2.0 >= IntToFloat(nHD))
                    //{

                    if((nClassLevel/2) >= nHD)
                    {
                        if (nPlanar>0 && nRacial == RACIAL_TYPE_OUTSIDER)
                        {
                            effect ePlane2 = EffectVisualEffect(VFX_IMP_UNSUMMON);
                            ApplyEffectToObject(DURATION_TYPE_INSTANT, ePlane2, oTarget);
                        }

                        effect ePlane2 = EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_HOLY);

                        //Fire cast spell at event for the specified target
                        SignalEvent(oTarget, EventSpellCastAt(oBoom, SPELLABILITY_TURN_UNDEAD));
                        //Destroy the target
                        DelayCommand(0.1f, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget));
                    }
                    else
                    {
                        //Turn the target
                        //Fire cast spell at event for the specified target
                        SignalEvent(oTarget, EventSpellCastAt(oBoom, SPELLABILITY_TURN_UNDEAD));
                        AssignCommand(oTarget, ActionMoveAwayFromObject(oBoom, TRUE));
                        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nClassLevel + 5));
                    }
                    nHDCount = nHDCount + nHD;
                }
            }
            bValid = FALSE;
        }
        nCnt++;
        oTarget = GetNearestCreature(CREATURE_TYPE_IS_ALIVE,TRUE, oBoom, nCnt,CREATURE_TYPE_PERCEPTION , PERCEPTION_SEEN);
    }
    DestroyObject(oBoom, 1.0);//cleanup the target object
}

// The individual event handlers.

void OnActivate(object oItem, object oTarget, location lTarget, object oActivator);


// The main function.
void main()
{
int nEvent = GetUserDefinedItemEventNumber();

// Spells might continue to their spell scripts. All other events are
// completely handled by this script.
if ( nEvent != X2_ITEM_EVENT_SPELLCAST_AT )
SetExecutedScriptReturnValue();

// Determine which event triggered this script's execution.
switch ( nEvent )
{
// Item was activated ("activate item" or "unique power").
case X2_ITEM_EVENT_ACTIVATE:
OnActivate(GetItemActivated(), GetItemActivatedTarget(),
GetItemActivatedTargetLocation(), GetItemActivator());
break;
}
}
// -----------------------------------------------------------------------------
// oItem was activated ("activate item" or "unique power").
// Run by the module.
void OnActivate(object oItem, object oTarget, location lTarget, object oActivator)
{
object oPC = oActivator;
    location lLoc = lTarget;//GetItemActivatedTargetLocation();

   object oItemActivate = oTarget;//GetItemActivatedTarget();
   TurnUndead(oPC, lLoc);//GetSpellTargetLocation());
   DelayCommand(0.3, DoGrenade(d6(1),1, VFX_IMP_FLAME_M, VFX_FNF_FIREBALL,DAMAGE_TYPE_FIRE,RADIUS_SIZE_MEDIUM, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE));
   DelayCommand(0.3, ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectAreaOfEffect(AOE_PER_FOGFIRE), GetSpellTargetLocation(), RoundsToSeconds(5)));
   effect eBombFX = EffectVisualEffect(VFX_FNF_MYSTICAL_EXPLOSION);

   ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eBombFX, lLoc);

   effect eDamage = EffectDamage(d6(), DAMAGE_TYPE_FIRE, DAMAGE_POWER_NORMAL);
   effect eHurt = EffectVisualEffect(VFX_COM_HIT_FIRE);
   DelayCommand(0.3, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oItemActivate));
   DelayCommand(0.3, ApplyEffectToObject(DURATION_TYPE_INSTANT, eHurt, oItemActivate));
}

Thank you very much for the help. That’s a lot to digest. You wrote that up pretty fast. My heads still reeling from your script. Gonna go try plugging your code in and see what happens.
Again, thanks for the help!

It compiled correctly, but nothing seems to happen. I tried throwing 10 grenades at one skeleton, but nothing happened. I added your custom function too! Gonna try tweaking some numbers, cross your (my) fingers. :slight_smile:

I will try and test it today, too. Scripting while at work is dangerous business!
Was able to test and fixed my attempt. I edited the earlier post to reflect the new script. I assumed you wanted it to be a tag-based script for the item being activated tagged “BONE_BOMB”, so the script is saved “bone_bomb”. When the item is activated, it will call the script.

1 Like

Okay - so I played with it a bit more. And modified the above. In hindsight, making it level 6 is pretty powerful. But you can change it as you want. In the below version, I cleaned it up and made it adjustable by variables on the bomb. This is all still based on the default turn undead script from NWN which has some issues.

//"bone_bomb" Tag based script for using a Unique Item power which turns undead in a 30' radius around target location
//also does a medium radius grenade attack
/*Individual bombs can have variables set on them to adjust their power, radius and specials
Level       int     #       This will be the effective HD of the turn.  If blank, defaults to 1
Elemental   int     0, 1    Set to 1 to effect elementals more
Vermin      int     0, 1    Set to 1 to effect vermin critters
Constructs  int     0, 1    Set to 1 to effect constructs
GoodEvil    int     0, 1    Set to 1 to target alignment - not sure how this one works...
Planar      int     0, 1    Set to 1 to target Planars
Radius      float   #.#     Set to desired meters for radius.  If 0.0, defaults to 10.0
*/
#include "x2_inc_switches"
#include "x0_i0_spells"
void TurnUndead(object oItem, object oPC, location lLoc)
{
    int nPower = GetLocalInt(oItem, "Level");
    if(nPower==0) nPower = 1;
    int nTotalLevel =  nPower;
    int nTurnLevel = nPower;
    int nClassLevel = nPower;
    int nTurnCheck = d20();
    int nTurnHD = d6(2)+nPower;

    //Flags for bonus turning types
    int nElemental = GetLocalInt(oItem, "Elemental");
    int nVermin = GetLocalInt(oItem, "Vermin");
    int nConstructs = GetLocalInt(oItem, "Constructs");
    int nGoodOrEvilDomain =  GetLocalInt(oItem, "GoodEvil");
    int nPlanar = GetLocalInt(oItem, "Planar");

    //Determine the maximum HD of the undead that can be turned.
    if(nTurnCheck <= 0)
    {
        nTurnLevel -= 4;
    }
    else if(nTurnCheck >= 1 && nTurnCheck <= 3)
    {
        nTurnLevel -= 3;
    }
    else if(nTurnCheck >= 4 && nTurnCheck <= 6)
    {
        nTurnLevel -= 2;
    }
    else if(nTurnCheck >= 7 && nTurnCheck <= 9)
    {
        nTurnLevel -= 1;
    }
    else if(nTurnCheck >= 10 && nTurnCheck <= 12)
    {
        //Stays the same
    }
    else if(nTurnCheck >= 13 && nTurnCheck <= 15)
    {
        nTurnLevel += 1;
    }
    else if(nTurnCheck >= 16 && nTurnCheck <= 18)
    {
        nTurnLevel += 2;
    }
    else if(nTurnCheck >= 19 && nTurnCheck <= 21)
    {
        nTurnLevel += 3;
    }
    else if(nTurnCheck >= 22)
    {
        nTurnLevel += 4;
    }
    //Gets all creatures in a 10m radius around the target location and turns them or not.  If the creatures
    //HD are 1/2 or less of the nClassLevel then the creature is destroyed.
    int nCnt = 1;
    int nHD, nRacial, nHDCount, bValid, nDamage;
    nHDCount = 0;
    effect eVis = EffectVisualEffect(VFX_IMP_SUNSTRIKE);
    effect eVisTurn = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_FEAR);
    effect eDamage;
    effect eTurned = EffectTurned();
    effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
    effect eLink = EffectLinkEffects(eVisTurn, eTurned);
    eLink = EffectLinkEffects(eLink, eDur);

    effect eDeath = SupernaturalEffect(EffectDeath(TRUE));

    effect eImpactVis = EffectVisualEffect(VFX_FNF_LOS_HOLY_30);
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpactVis, GetLocation(OBJECT_SELF));

    //Get nearest enemy within 10m (30ft) (default)
    //We create a waypoint at the targeted location to center the turning effect
    float fRad = GetLocalFloat(oItem, "Radius");
    if(fRad == 0.0) fRad = 10.0;
    object oBoom = CreateObject(OBJECT_TYPE_WAYPOINT, "nw_waypoint001", lLoc);
    object oTarget = GetNearestCreature(CREATURE_TYPE_IS_ALIVE, TRUE , oBoom, nCnt,CREATURE_TYPE_PERCEPTION , PERCEPTION_SEEN);
    while(GetIsObjectValid(oTarget) && nHDCount < nTurnHD && GetDistanceBetween(oBoom, oTarget) <= fRad)
    {
        if(!GetIsFriend(oTarget))
        {
            nRacial = GetRacialType(oTarget);


            if (nRacial == RACIAL_TYPE_OUTSIDER )
            {
                if (nPlanar)
                {
                     //Planar turning decreases spell resistance against turning by 1/2
                     nHD = GetHitDice(oTarget) + (GetSpellResistance(oTarget) /2) + GetTurnResistanceHD(oTarget);
                }
                else
                {
                    nHD = GetHitDice(oTarget) + (GetSpellResistance(oTarget) + GetTurnResistanceHD(oTarget) );
                }
            }
            else //(full turn resistance)
            {
                  nHD = GetHitDice(oTarget) + GetTurnResistanceHD(oTarget);
            }

            if(nHD <= nTurnLevel && nHD <= (nTurnHD - nHDCount))
            {
                //Check the various domain turning types
                if(nRacial == RACIAL_TYPE_UNDEAD)
                {
                    bValid = TRUE;
                }
                else if (nRacial == RACIAL_TYPE_VERMIN && nVermin > 0)
                {
                    bValid = TRUE;
                }
                else if (nRacial == RACIAL_TYPE_ELEMENTAL && nElemental > 0)
                {
                    bValid = TRUE;
                }
                else if (nRacial == RACIAL_TYPE_CONSTRUCT && nConstructs > 0)
                {
                    SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_TURN_UNDEAD));
                    nDamage = d3(nTurnLevel);
                    eDamage = EffectDamage(nDamage, DAMAGE_TYPE_MAGICAL);
                    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
                    DelayCommand(0.01, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget));
                    nHDCount += nHD;
                }
                else if (nRacial == RACIAL_TYPE_OUTSIDER && (nGoodOrEvilDomain+nPlanar > 0) )
                {
                    bValid = TRUE;
                }
                // * if wearing gauntlets of the lich,then can be turned
                else if (GetIsObjectValid(GetItemPossessedBy(oTarget, "x2_gauntletlich")) == TRUE)
                {
                    if (GetTag(GetItemInSlot(INVENTORY_SLOT_ARMS)) == "x2_gauntletlich")
                    {
                        bValid = TRUE;
                    }
                }

                //Apply results of the turn
                if( bValid == TRUE)
                {
                    SendMessageToPC(oPC, GetName(oTarget)+" was turned by the bomb!");
                    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);

                    if (nPlanar>0 && nRacial == RACIAL_TYPE_OUTSIDER)
                    {
                        effect ePlane = EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_HOLY);
                        ApplyEffectToObject(DURATION_TYPE_INSTANT, ePlane, oTarget);
                    }
                    //if(IntToFloat(nClassLevel)/2.0 >= IntToFloat(nHD))
                    //{

                    if((nClassLevel/2) >= nHD)
                    {
                        if (nPlanar>0 && nRacial == RACIAL_TYPE_OUTSIDER)
                        {
                            effect ePlane2 = EffectVisualEffect(VFX_IMP_UNSUMMON);
                            ApplyEffectToObject(DURATION_TYPE_INSTANT, ePlane2, oTarget);
                        }

                        effect ePlane2 = EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_HOLY);

                        //Fire cast spell at event for the specified target
                        SignalEvent(oTarget, EventSpellCastAt(oBoom, SPELLABILITY_TURN_UNDEAD));
                        //Destroy the target
                        DelayCommand(0.1f, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget));
                    }
                    else
                    {
                        //Turn the target
                        //Fire cast spell at event for the specified target
                        SignalEvent(oTarget, EventSpellCastAt(oBoom, SPELLABILITY_TURN_UNDEAD));
                        AssignCommand(oTarget, ActionMoveAwayFromObject(oBoom, TRUE));
                        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nClassLevel + 5));
                    }
                    nHDCount = nHDCount + nHD;
                }
            }
            bValid = FALSE;
        }
        nCnt++;
        oTarget = GetNearestCreature(CREATURE_TYPE_IS_ALIVE,TRUE, oBoom, nCnt,CREATURE_TYPE_PERCEPTION , PERCEPTION_SEEN);
    }
    DestroyObject(oBoom, 1.0);//cleanup the target object
}
// The individual event handlers.
void OnActivate(object oItem, object oTarget, location lTarget, object oActivator);

// The main function.
void main()
{
int nEvent = GetUserDefinedItemEventNumber();

// Spells might continue to their spell scripts. All other events are
// completely handled by this script.
if ( nEvent != X2_ITEM_EVENT_SPELLCAST_AT )
SetExecutedScriptReturnValue();

// Determine which event triggered this script's execution.
switch ( nEvent )
{
// Item was activated ("activate item" or "unique power").
case X2_ITEM_EVENT_ACTIVATE:
OnActivate(GetItemActivated(), GetItemActivatedTarget(),
GetItemActivatedTargetLocation(), GetItemActivator());
break;
}
}
// -----------------------------------------------------------------------------
// oItem was activated ("activate item" or "unique power").
// Run by the module.
void OnActivate(object oItem, object oTarget, location lTarget, object oActivator)
{
    object oPC = oActivator;
    location lLoc = lTarget;
    TurnUndead(oItem, oPC, lLoc);
    //Do additional bomb explosion - delay is to allow Turning to clear.  This will only target still standing creatures
    DelayCommand(0.3, DoGrenade(d6(1),1, VFX_IMP_FLAME_M, VFX_FNF_FIREBALL,DAMAGE_TYPE_FIRE,RADIUS_SIZE_MEDIUM, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE));
    DelayCommand(0.3, ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectAreaOfEffect(AOE_PER_FOGFIRE), GetSpellTargetLocation(), RoundsToSeconds(5)));
    effect eBombFX = EffectVisualEffect(VFX_FNF_MYSTICAL_EXPLOSION);
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eBombFX, lLoc);
}

The only thing I think I’m a little confused on, is that I don’t see any reference to the original part of the item. Where do I insert this code or do I? Either way, I sure do apperciate your help. PS. Don’t get fired from work for coding under duress! Lol :slight_smile:

object oUsed = GetItemActivated();
if (GetTag(oUsed) == “BONE_BOMB”)
{
}

I’ve got it now! Awesome work Mannast! Works perfectly now! Can’t thank you enough. Now I’m gonna go have some fun tweaking it a bit! :slight_smile:

1 Like

Yay!