The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Totally stumped on the "New" spells.
Author Message
Anarch Cassius
Master
**

Posts: 273
Likes Given: 19
Likes Received: 10 in 9 posts
Joined: Mar 2012
Reputation: 2



Post: #4
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.
(This post was last modified: 07-21-2012 07:33 AM by Anarch Cassius.)
07-21-2012 07:07 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Totally stumped on the "New" spells. - Anarch Cassius - 07-21-2012 07:07 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)