Anarch Cassius 
Master
 
Posts: 273
Likes Given: 19
Likes Received: 10 in 9 posts
Joined: Mar 2012
Reputation: 2
![]()
|
RE: Totally stumped on the "New" spells.
Yes. Spells need to be scripted in a certain way to work as potions. I suspect not all internal spells have this in mind
Code:
[spell 154]
defname=s_warmth
name=Warmth
sound=1482
runes=BF
cast_time=1.0
resources=i_reag_sulfur_ash,i_reag_obsidian
rune_item=i_rune_warmth
scroll_item=i_scroll_warmth
flags=SPELLFLAG_TARG_CHAR | SPELLFLAG_FX_TARG | spellflag_good
effect_id=i_fx_bless_effect
effect=10,25
duration=2*60,6*60
manause=6
skillreq=Necromancy 20.0
INTERRUPT=100.0,30.0
ON=@effect
IF (<ARGO.TYPE>==t_potion)
obj=<src>
ELSE
obj=<src.act>
endif
if <obj.findid.i_warmth_timer>
obj.rescold -= <obj.findid.i_warmth_timer.tag.rescold>
obj.findid.i_warmth_timer.remove
endif
local.lo=<strarg <serv.spell.<argn1>.effect>>
local.hi=<streat <serv.spell.<argn1>.effect>>
src.newitem i_warmth_timer
new.tag.rescold = <local.lo>+(((<local.hi>-<local.lo>)*<argn2>)/1000)
local.lo=<eval <strarg <serv.spell.<argn1>.duration>>>
local.hi=<eval <streat <serv.spell.<argn1>.duration>>>
new.tag.timer = <local.lo>+(((<local.hi>-<local.lo>)*<argn2>)/1000)
new.LINK=<obj>
IF (<ARGO.TYPE>==t_potion)
IF (<OBJ.FINDLAYER.44>)
OBJ.FINDLAYER.44.REMOVE
endif
new.layer=44
endif
trysrc <obj> new.equip
[itemdef i_warmth_timer]
ID=i_memory
name=Warmth Timer
TYPE=t_eq_script
on=@create
ATTR=attr_invis|attr_decay
on=@equip
link.rescold += <tag0.rescold>
timer = <tag.timer>
on=@timer
link.rescold -= <tag0.rescold>
remove
return 1
The bit with OBJ at the begining of @effect is the trick. We need to get the user in a slightly different way for potions. Also making the effect go to the potion layer if appropriate. The remove bit with the layer at the end is untested but the idea is that in Sphere rules you can be affected by one potion at a time, so we remove the existing one and make sure this effect will be considered a potion by future quaffings.
Scrolls and wands work fine by default. I haven't experimented with the default spells on equipment system as it's erratic even with internal spells.
|
|
07-21-2012 07:07 AM |
|
|