There is a small problem that I ran into when I created a light spell the other day. It's not really a coding issue, as I got that part to work, it's the scripting on the light object created.
In order to use it, you need a rod with a glass globe. The idea behind this is you put some power into the glass globe, which makes it glow and provide the light. So, on casting 'create light,' I used mag_materials to consume the required component (rod with glass globe) and create the light source (rod with a glowing glass globe).
I figured that I could just put a timer on this object. When the timer goes off, I used a timer script to set off something like this...
Code:
%echo% The light within the glass globe flickers then goes out.
%load% obj 105 %actor% inv
%purge% %self%
This goes off without a hitch, except for one snag: the object is just dropped into the room. I'm wanting to have it at least remain in the player's inventory, otherwise it gets annoying having to worry about dropping it for some reason when the light goes out. Any ideas on how to tackle this?
Another idea I had, though this is more of a coding solution, is a combination of using %transform%, otimer, and a second mag_materials call to check for the rod with a glowing globe (it wouldn't look like it, after being transformed into a normal, non-glowing rod, but have the same vnum).
Anyways, thanks again for all the great help here. I'd be lost without it!