Aller au contenu

Photo

Do something if a certain spell is cast


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
andysks

andysks
  • Members
  • 1 650 messages

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.



#2
kevL

kevL
  • Members
  • 4 061 messages

hey Andy,
you're looking for the onSpellCastAt event. possible functions are

GetLastSpell()
GetLastSpellCaster()
etc.


  • andysks aime ceci

#3
Dann-J

Dann-J
  • Members
  • 3 161 messages

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
andysks

andysks
  • Members
  • 1 650 messages

Perfect. Thanks. I will return here if my script won't work :D.



#5
kevL

kevL
  • Members
  • 4 061 messages

bork.jpg