
I am making a bomb spell that when you hit a target it spawns a bomb next to them.
In 5 seconds it is supposed to explode and the bomb is removed.
How do I cast the spell or make the effect happen on the bomb I summoned?
I have tried .cast but the reference type only works if I have player in it but I don't want the spell to originate from the player because the bomb is supposed to be allowed to be used remotely. (when the player is in another room)
Here is the code if it helps:
Scriptname PhenderixBombScript extends ActiveMagicEffect
float property howLong auto
Spell property explosionSpell auto
ObjectReference property bomb auto
ObjectReference property resetPoint auto
Event OnEffectStart(Actor akTarget, Actor akCaster)
Form blockForm = Game.GetForm(0x0003E225)
float xOriginal = akCaster.x
float yOriginal = akCaster.y
float zOriginal = akCaster.z
ObjectReference blockPlaced = akTarget.PlaceAtMe(blockForm)
Debug.MessageBox("Bomb placed.")
Utility.wait(howLong)
explosionSpell .cast(blockPlaced, blockPlaced) ;THIS IS THE PROBLEM LINE, nothing happens. If I change the first blockplaced to the player then it works but the player has to have line of site. (I am using an empty projectile)
Debug.MessageBox("Bomb has exploded.")
blockPlaced.moveTo(resetPoint)
EndEvent
Thanks,
phenderix
