Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

How can I track what spells are cast on an activator by script?


Sigurd Stormhand
 Share

Recommended Posts

OK, the situation is this. As part of a quest I want to "experiment" on a rock by casting a shock shield and then ranged shock spell on it - then the quest should update.

I know you can use script effect spells on corpses, doors, etc. but I'm not sure about activators.

The sequnce of events needs to go like this.

1. Player and mage arrive at location - quest updates.

2. Mage gives player two scrolls, one shock shield, one ranged shock spell, asks player to cast on rock - quest updates.

3. Player casts shock shield on rock - quest updates?

4. Player casts ranged shock on rock - quest updates.

5. Mage tells player how interesting that was, quest updates.

I'm clear on how stages 1,2 and 5 will work, but not how to get from 2 to 4.

Thoughts?

Invisible (physivally and mapwise) automatic door with no teleport to use as the activator?

Link to comment
Share on other sites

You can use a couple of OnMagicEffectHit blocks on the activator. Example

scn Whatever


BEGIN ONMAGICEFFECTHIT LISH    ; LISH is the effect code for shock shield


if ( GetStage MyQuest == 30 )

    SetStage MyQuest 40

endif


END


BEGIN ONMAGICEFFECTHIT SHDG    ; SHDG is the effect code for shock damage


if ( GetStage MyQuest == 40 )

    SetStage MyQuest 50

endif


END

Note that this block does not differentiate between touch and ranged effects. If it is mission critical that only a ranged effect should update the quest, there is a rather complex, indirect way of doing it involving getting the reference of every missile launched from the player... I'll have to dig it up if you really need it. :)

Edited by Lanceor
Link to comment
Share on other sites

Note that this block does not differentiate between touch and ranged effects. If it is mission critical that only a ranged effect should update the quest, there is a rather complex, indirect way of doing it involving getting the reference of every missile launched from the player... I'll have to dig it up if you really need it. :)

Or you could just put the activator somewhere the player can't reach. :P

Edited by ThomasKaira
Link to comment
Share on other sites

You can use a couple of OnMagicEffectHit blocks on the activator. Example

scn Whatever


BEGIN ONMAGICEFFECTHIT LISH	; LISH is the effect code for shock shield


if ( GetStage MyQuest == 30 )

	SetStage MyQuest 40

endif


END


BEGIN ONMAGICEFFECTHIT SHDG	; SHDG is the effect code for shock damage


if ( GetStage MyQuest == 40 )

	SetStage MyQuest 50

endif


END

Note that this block does not differentiate between touch and ranged effects. If it is mission critical that only a ranged effect should update the quest, there is a rather complex, indirect way of doing it involving getting the reference of every missile launched from the player... I'll have to dig it up if you really need it. :)

Ah, thank you, that is exactly what I wanted. It does need to be a ranged spell, but that can be taken care of with a distance check in this case - it's less about the rock and more about the water it's in.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...