Jump to content

[LE] How to set up a summon spell to summon a random NPC?


Recommended Posts

I'm working on some spells to summon different NPCs.

Some NPCs have a male and female version. Or a melee version, magic version and a bow version.

Like, a "summon dremora" spell that has an equal chance of summoning my male melee, magic or bow dremora NPC or summoning my female melee, magic or bow dremora npc. (Just randomly pick 1 out of the 6 and summon it like a normal summoning spell)

I really have no idea how to go about that, But I don't want to clutter up the game with 500 different summoning spells, so I thought I'd ask here for help fixing it up somehow.

Link to comment
Share on other sites

1) Create a conjuration spell for each of your 'different' actors as you would normally create.


2) Create a spell 'fire and forget', and in its magic effect:

Archetype = Script

* Don't tick any options, just leave it empty.


In the script section add this script:



Spell Property Spell01 Auto
Spell Property Spell02 Auto
Spell Property Spell03 Auto
Spell Property Spell04 Auto
Spell Property Spell05 Auto

EVENT OnEffectStart(Actor akTarget, Actor akCaster)
Int RandomSpell = RandomInt(0, 4)
If ( RandomSpell == 0 )
Spell01.Cast(akCaster, akCaster)
ElseIf ( RandomSpell == 1 )
Spell02.Cast(akCaster, akCaster)
ElseIf ( RandomSpell == 2 )
Spell03.Cast(akCaster, akCaster)
ElseIf ( RandomSpell == 3 )
Spell04.Cast(akCaster, akCaster)
ElseIf ( RandomSpell == 4 )
Spell05.Cast(akCaster, akCaster)
EndIf
ENDEVENT



Fill in of the spells you created in step '1' in the script's properties, and you are done.

Edited by maxarturo
Link to comment
Share on other sites

 

1) Create a conjuration spell for each of your 'different' actors as you would normally create.
2) Create a spell 'fire and forget', and in its magic effect:
Archetype = Script
* Don't tick any options, just leave it empty.
In the script section add this script:
Spell Property Spell01 Auto
Spell Property Spell02 Auto
Spell Property Spell03 Auto
Spell Property Spell04 Auto
Spell Property Spell05 Auto
 
EVENT OnEffectStart(Actor akTarget, Actor akCaster)
      Int RandomSpell = RandomInt(0, 4)
      If ( RandomSpell == 0 )
           Spell01.Cast(akCaster, akCaster)
  ElseIf ( RandomSpell == 1 )
           Spell02.Cast(akCaster, akCaster)
  ElseIf ( RandomSpell == 2 )
           Spell03.Cast(akCaster, akCaster)
  ElseIf ( RandomSpell == 3 )
           Spell04.Cast(akCaster, akCaster)
  ElseIf ( RandomSpell == 4 )
           Spell05.Cast(akCaster, akCaster)
   EndIf
ENDEVENT
Fill in of the spells you created in step '1' in the script's properties, and you are done.

 

wow way more simple than I expected! Thank you ^_^

Link to comment
Share on other sites

keep in mind, because I forgot to mention it, that the spell you create in step '2' is the spell that the player or the actor will use as the 'Random Conjuration Spell' (will be added to the actor's inventory).

Link to comment
Share on other sites

Maxturo has a solid method. If you wanted though, you could make a leveled actor record and/or a formlist, and have it choose randomly from that too. One spell. One random entity when cast. But I do suppose they would need some kind of maintenance if not being "treated" under the hood as a summon. So add an ability to them to cleanup etc like regular summons do

 

I tend to favor this route since easy to make a huge pool of possible spawns, as well as not being concerned with summon limit. But you might prefer the limit

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...