Skip to content

Trouble Spawning Using EffectSummonCreature()

Just trying to summon a shadow fiend to fight at my side?

Code:
object oUsed3 = GetItemActivated();
    oPC = GetItemActivator();
    if (GetTag(oUsed3) == "GEM_NIGHTPLANE")
    {

          location lLoc = GetLocation(oPC);
          effect eEffect = EffectSummonCreature("shfiend002", VFX_IMP_DEATH_WARD, 1.5, TRUE);
          ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eEffect, GetItemActivatedTargetLocation(), 
         1800.0);
    }

Comments

  • ProlericProleric Member Posts: 1,281
    edited April 2022
    The problem is that only creatures can summon. Item activation is performed by a module script, so you're asking the module to do the summoning, which is forbidden.

    You need to tell the PC to both create and apply the effect. The simplest way to do that is
              AssignCommand(oPC, ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, 
                                                      EffectSummonCreature("shfiend002", VFX_IMP_DEATH_WARD, 1.5, TRUE), 
                                                      GetItemActivatedTargetLocation(), 1800.0));
    

    If you prefer to keep effect creation and application as two lines, put both statements in a function or script, then use AssignCommand or ExecuteScript respectively.
Sign In or Register to comment.