Spell Quandaries

Post » Sun Jun 24, 2012 8:44 am

I need a spell that does the following for an NPC:

Functional: 4 Magic Missiles (Homing projectiles that do scripted damage) - This I've worked out previously with some help from you fellows. Unfortunately, the way I got it working involved filling an Alias with an NPC and having items drop out into the world with a homing script for the alias. The computer doesn't know how to use that, so...darn.

Visual: I need a big symbol to appear under the caster's feet briefly, then go away and the magic missiles come out. My thought is that I can do this by having akCaster cast a spell on self with an explosion that looks like a Lightning Rune on self, but one that isn't functional. Would that work?

It would also be nice if I could have a spell that sets up a colored force field around the caster, but that's another story.
User avatar
renee Duhamel
 
Posts: 3371
Joined: Thu Dec 14, 2006 9:12 am

Post » Sun Jun 24, 2012 10:52 am

Homing projectiles sounds like a script should spawn objects that TranslateToRef, and trigger explosions OnTranslationComplete which despawn the projectiles.

Your visual idea sounds like it should work.
User avatar
katie TWAVA
 
Posts: 3452
Joined: Tue Jul 04, 2006 3:32 am

Post » Sun Jun 24, 2012 3:40 pm

Ah, thanks. I can do that. I have it work differently for the player, but that makes sense for the NPC.
User avatar
Kayla Keizer
 
Posts: 3357
Joined: Tue Dec 12, 2006 4:31 pm

Post » Sun Jun 24, 2012 3:40 pm

I was making a homing spell of my own, so how do you do it?
User avatar
Jack Walker
 
Posts: 3457
Joined: Wed Jun 06, 2007 6:25 pm

Post » Sun Jun 24, 2012 8:29 am

http://www.gamesas.com/topic/1350413-targettable-projectiles-and-multiple-projectiles-from-the-same-spell/page__fromsearch__1 has a video of a homing projectile and kinda describes the process. It's a bit slow though, so might not be what you're looking for.
User avatar
Darren
 
Posts: 3354
Joined: Wed Jun 06, 2007 2:33 pm

Post » Sun Jun 24, 2012 8:32 am

"A bit slow" works for me - the spell I'm mucking around with is supposed to be slow but relentless in exchange for being able to fire around corners and junk.
User avatar
meg knight
 
Posts: 3463
Joined: Wed Nov 29, 2006 4:20 am

Post » Sun Jun 24, 2012 7:05 am

It's actually awkward, but it works. Basically, in DnD magic missiles are handled by two spells, one which takes time to cast and fills your inventory with magic missiles, and one that casts them at someone. The first spell adds several MiscObjects, each of which has a script like so:

Scriptname DnDMMissileScript extends activemagiceffectFaction Property DnDMageLevel autoMiscObject Property DnDMMissileLight autoSpell Property DnDMMissileFireSpell autoevent OnEffectStart(Actor akTarget, Actor akCaster)int MageLevel = akCaster.GetFactionRank(DnDMageLevel) as int  if MageLevel >=9   MageLevel=9endIfMageLevel = ((MageLevel +-1)/2) + 1akCaster.addItem(DnDMMissileLight, MageLevel)	  akCaster.addSpell(DnDMMissileFireSpell)endEvent

The Item's script:

Scriptname DnDMMissileLightScript extends ObjectReference  ReferenceAlias Property DnDMMissileTarget autoEvent OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)   if akNewContainer==None	   (self as ObjectReference).MoveTo(akOldContainer, Utility.RandomInt(-100,100), 60)endIfendEventevent OnTranslationComplete()(self as ObjectReference).SplineTranslateToRefNode(DnDMMissileTarget.GetReference(), "NPC Spine1 [Spn1]", 2.0, 300.00,  0.0)Self.RegisterForSingleUpdate(0.01)endEventevent OnUpdate()   Actor HitActor = DnDMMissileTarget.GetReference() as actor   int MMissileDam = Utility.RandomInt(2,5)   HitActor.DamageAV("Health", MMissileDam)   self.disable()   Utility.Wait(5)   DnDMMissileTarget.Clear()endEvent

The casting spell fills SomeAlias, and force drops the items from inventory like so:

Scriptname DnDMMIssileFireScript extends activemagiceffectReferenceAlias Property DnDMMissileTarget autoMiscObject Property DnDMMissileLight autoSpell Property DnDMMissileFireSPell autoevent OnEffectStart(Actor akTarget, Actor akCaster)   DnDMMissileTarget.ForceRefTo(akTarget as ObjectReference)   int MMissileCount = akCaster.GetItemCount(DnDMMissileLight)   int MissileDropper = 0   while MissileDropper<= MMissileCount	  akCaster.DropObject(DnDMMissileLight)	  MissileDropper = MissileDropper+1	  Utility.Wait(0.35)   endWhile   akCaster.RemoveSpell(DnDMMissileFireSpell)endEvent
User avatar
matt white
 
Posts: 3444
Joined: Fri Jul 27, 2007 2:43 pm

Post » Sun Jun 24, 2012 6:13 am

Oh, come on. If you were going to go to that effort, should have done 1d4+1 instead of 1d6.

I kid, I kid.
User avatar
Dale Johnson
 
Posts: 3352
Joined: Fri Aug 10, 2007 5:24 am

Post » Sun Jun 24, 2012 8:36 am

Oh, I had another question to:
Has anyone worked extensively with making NPCs go through lists of spells while they are in combat? I have a bunch fo scripted spells I need an NPC boss to cast, and what I'm currently trying with a Combat PackageList of UseMagic packages isn't working. He casts the first one after a weird delay, and then just holds his hand up like he's going to cast it again, but doesn't. He won't move on to the next spell (the magic missile spell).
User avatar
Philip Lyon
 
Posts: 3297
Joined: Tue Aug 14, 2007 6:08 am

Post » Sun Jun 24, 2012 4:49 am

Oh, come on. If you were going to go to that effort, should have done 1d4+1 instead of 1d6.

I kid, I kid.

If you'll note, I did. I just had it written wrong in the description. LOLZ ON YOU NOW KID! jk
User avatar
Claudia Cook
 
Posts: 3450
Joined: Mon Oct 30, 2006 10:22 am


Return to V - Skyrim