Quest advances when PC hit by spell

Post » Wed Oct 22, 2014 10:59 am

Another Scripting question.

I need to have a quest stage advance when the PC is hit by a spell from a specific NPC

I have an exsisting Script for something simular but as the script is attached to the NPC it would not work for the PC.

Existing script that won't work for desired effect but ;

ScriptName ExampleQuestTrigger Extends ObjectReferenceActor Property PlayerRef AutoQuest Property QUEST  AutoMagicEffect Property SPELL AutoEvent OnMagicEffectApply(ObjectReference akCaster, MagicEffect akEffect)    if (akCaster == PlayerRef && akEffect == SPELL)        QUEST.SetStage(30)        GoToState("Disabled")    endifEndEventState Disabled    Event OnMagicEffectApply(ObjectReference akCaster, MagicEffect akEffect)    EndEventEndState

I can't attach the script to the player. I could create a unique use once spell but don't know how I would apply it to the spell to setstage when it is cast upon the PC.

Any help would be appreciated.

Thank you

User avatar
darnell waddington
 
Posts: 3448
Joined: Wed Oct 17, 2007 10:43 pm

Post » Wed Oct 22, 2014 3:21 am

For things you want to specifically work on the player, that cannot be done by means of ActiveMagicEffect, you need to make the Player an alias in a quest and attach it via ReferenceAlias script.

User avatar
Talitha Kukk
 
Posts: 3477
Joined: Sun Oct 08, 2006 1:14 am

Post » Wed Oct 22, 2014 10:58 am

I understand what you are saying but lack the knowledge on what to put.

So based on what you replied it would need to be in Quest Stages Tab?

You wouldn't be able to share an example script would you?

User avatar
Phoenix Draven
 
Posts: 3443
Joined: Thu Jun 29, 2006 3:50 am

Post » Wed Oct 22, 2014 10:54 am

Update. Appears it can work as a scene, opened MGRAppBrelyna01 where the same effect is used, basically.

Thank you for trying!

User avatar
Motionsharp
 
Posts: 3437
Joined: Sun Aug 06, 2006 1:33 am

Post » Wed Oct 22, 2014 11:13 am

An alias is placed in the Quest Alias tab.

The ReferenceAlias script is attached to the alias. There is a script field to the right in the Alias window for you to add the script to. Adding the script is the same way you added that script above.

All you have to do is change extends ObjectReference to extends ReferenceAlias.

Make sure to refill the properties.

Edit: Ah ok, then have fun.

User avatar
Robert Garcia
 
Posts: 3323
Joined: Thu Oct 11, 2007 5:26 pm


Return to V - Skyrim