Jump to content

[How to] getting variables from an active magic effect into a quest script.


jbezorg

Recommended Posts

The base quest script

Scriptname _ae_framework extends Quest  Conditional

Actor[]             Property monitored        Auto
ActiveMagicEffect[] Property monitoredEffect  Auto

The magic effect script ( assuming that the actor that is the spell target has already been added to monitored[] )

Scriptname _ae_events_mes extends activemagiceffect  

_ae_framework   property ae                    auto
String          property test = "hello world"  auto  

Int magicEffectIdx

event OnEffectStart(Actor akTarget, Actor akCaster)
	magicEffectIdx = ae.monitored.Find(akTarget)
	ae.monitoredEffect[ magicEffectIdx ] = self
endEvent

event OnEffectFinish(Actor akTarget, Actor akCaster)
	ae.monitoredEffect[ magicEffectIdx ] = none
endEvent

Now the base quest can access the active magic effect through monitoredEffect[]

String function GetActiveMagicEffectString(Actor akActor)
	Int idx = monitored.Find(akActor)
	if idx >= 0
		return ( monitoredEffect[idx] as _ae_events_mes ).test
	endIf
endFunction
Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use