Hi all. I am writing this before I do my own research since the toolset is out of reach at the moment. But is it possible to script something to happen if a certain spell is cast somewhere? Like, cast fireball on an altar and spawn something... or whatever. I think it's possible. If I remember correctly they did something like that in the OC with some boulders. And maybe I've seen such things in other modules... but for which functions should I be looking for later when I try to script such a thing? Because I'm certain that a search for "spell" will return 1000 results.
Do something if a certain spell is cast
#1
Posté 09 octobre 2014 - 06:12
#2
Posté 09 octobre 2014 - 06:19
hey Andy,
you're looking for the onSpellCastAt event. possible functions are
GetLastSpell()
GetLastSpellCaster()
etc.
- andysks aime ceci
#3
Posté 09 octobre 2014 - 11:25
Be warned however that some AEO spells don't check for placeables, so they don't broadcast the OnSpellCastAt event to them. Fireball works fine though, as it will also damage placeables or doors (ipoints being considered placeables).
I had a hard time detecting when the sleep spell was cast at a particular location, as the spell script only considers creatures as valid targets. I had to use a hostile scriptless rat scaled down to almost nothing, with an ethereal effect on it to prevent party members trying to attack it. The other option was to modify the sleep spell to broadcast the OnSpellCastAt event to placeables - but one look at the multiple nested loops in that script scared me off. Ethereal micro-rat was the much easier option.
- andysks aime ceci
#4
Posté 10 octobre 2014 - 01:10
Perfect. Thanks. I will return here if my script won't work
.
#5
Posté 10 octobre 2014 - 02:50






Retour en haut






