Skip to content

OnActivate Summon Question

How do I get a custom summon to join my party and fight for me? I want its picture to show up in the upper right-hand corner as well.
The way I see it, right now I have no control over the summon, whether it defends me or not. I just want the spider figurine to summon a sword spider, for its picture to show up, and for it to defend me! I don't want much, right? lol

This is all I have so far. I don't even no if I'm dancing around the answer or not...
// Spider Figurine
    object oUsed2 = GetItemActivated();
    if (GetTag(oUsed2) == "SPIDER_FIG_001")
    {
       object oPC = GetItemActivator();
       effect eFX = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_2);

       object oSummon;
       oSummon = GetObjectByTag("SWORD_S_001");
       if (GetMaster(oSummon) == oPC)
       {

         ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eFX, GetSpellTargetLocation());
         CreateObject(OBJECT_TYPE_CREATURE, "spidswrd002", GetSpellTargetLocation());


       }
    }

Comments

  • NeverwinterWightsNeverwinterWights Member Posts: 339
    Depends on how far you want to go with it. Like if you want it to level up with you and all that. Simplest way to do it. Make a custom blueprint spider. Change all of it's scripts to:

    OnBlocked=nw_ch_ace
    OnDamaged=nw_ch_ac5
    OnDeath=nw_ch_ac7
    OnConversation=nw_ch_ac4
    OnDisturbed=nw_ch_ac8
    OnCombatRoundEnd=nw_ch_ac3
    OnHeartbeat=nw_ch_ac1
    OnPhysicalAttacked=nw_ch_ac5
    OnPerception=nw_ch_ac2
    OnRested=nw_ch_aca
    OnSpawn=nw_ch_summon_9
    OnSpellCast=nw_ch_acb
    OnUserDefined=nw_ch_acd

    Then summon your new spider with your item:
    #include "x2_inc_switches"
    void main()
    {
        int iEvent = GetUserDefinedItemEventNumber();
        if (iEvent != X2_ITEM_EVENT_ACTIVATE) return;
    
        object oPC = GetItemActivator();
        location lLoc = GetItemActivatedTargetLocation();
    
        object oSummon = CreateObject(OBJECT_TYPE_CREATURE, "spidswrd001", lLoc, TRUE);
        AddHenchman(oPC, oSummon);
    }
    

    More info on creating summons, animal companions, and henchmen:

    https://neverwintervault.org/article/reference/how-make-custom-familiars-and-animal-companions
Sign In or Register to comment.