Miracle Scripts

From PBnWModdingWIKI

The Lava Pool Miracle! 00din


begin script MiracleTest
	oSpellVisual = 0
	oSpellDropVisual = 0
	oSpellObject = 0
	nEnd = 0
start
	wait until key KB_1 down
	oSpellObject = create SCRIPT_OBJECT_TYPE_MOBILE_STATIC MOBILE_STATIC_INFO_BOULDER_ROUND at hand position
	oSpellVisual = create visual effect VISUAL_EFFECT_FIREBALL on oSpellObject time -1

	set oSpellObject alpha 0.0
	set oSpellObject in player 0 hand 

	begin loop
		if bindable action BINDABLE_ACTION_TYPE_ACTION performed
			if get player 0 influence at hand position > 0.0
				delete oSpellObject
				// Do miracle stuff.
				oSpellDropVisual = create visual effect VISUAL_EFFECT_FIREDROP_AIR at hand position
				set lava puddle at hand position radius 7 temperature 1

				nEnd = 1
			end if
		end if

		if oSpellObject != get object held
			delete oSpellObject
			nEnd = 1
		end if

		until nEnd == 1
	end loop

	run background script MiracleTest

end script MiracleTest