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
Will this work, and how to short it down
Author Message
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #2
RE: Will this work, and how to short it down
well for custom spell effects i think using @effect under spells will be better solution like

PHP Code:
[Spell 18]
DEFNAME=s_fireball
NAME
=Fireball
SOUND
=snd_SPELL_FIREBALL
RUNES
=VF
CAST_TIME
=1.6
RESOURCES
=i_reag_black_pearl
RUNE_ITEM
=i_rune_FIREBALL
SCROLL_ITEM
=i_scroll_FIREBALL
FLAGS
=SPELLFLAG_DIR_ANIM SPELLFLAG_HARM SPELLFLAG_TARG_CHAR SPELLFLAG_FX_TARG
EFFECT_ID
=i_fx_fireball
EFFECT
=8,16
DURATION
=0.0
MANAUSE
=9
SKILLREQ
=MAGERY 30.0
INTERRUPT
=100.0,100.0

ON
=@Effect
custom_fire_effect 
<argo>
return 
1

[function custom_fire_effect]
if (<
uid> = <src>) //check is damage spell targeted to self
    
return 1    
elif 
<custom_spell_check <argn1>>
    
local.refd = <reflection_check>
    
local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
    
local.skillrand=(<magery> + <inscription> + <evaluatingintel>)/150
    local
.firemagic=<EVAL <local.firemagic> + rand(<eval <local.skillrand>/2> ,<eval <local.skillrand>>)>
    
local.firemagic=<EVAL <local.firemagic> - <resfire>> 
    if <
local.refd> = 0
        damage 
<eval < local.firemagic>> dam_fire <src>
   
elif <local.refd> = 1
       src
.damage <eval < local.firemagic>> dam_fire <src>
   endif 
endif


[function 
custom_spell_check//check the source because if source is item formulas can return odd results
ref1 = <argn1>
if (<
ref1>)
    if (<
ref1.type> = t_scroll) || (<ref1.type> = t_wand
        return 
1
    
else
        return 
0
    
endif    
elif (<isitem>)
    return 
0    
else
    return 
1
endif


[function 
reflection_check]
if ((<
findid.i_rune_magic_reflection>) && !(<src.uid> = <uid>))
    if <
src.findid.i_rune_magic_reflection>
        
findid.i_rune_magic_reflection.remove
        src
.findid.i_rune_magic_reflection.remove
        SRC
.EFFECT=3,037b9,6,15,1
        EFFECT
=3,037b9,6,15,1
        
return 2
    
else
        
findid.i_rune_magic_reflection.remove
        EFFECT
=3,037b9,6,15,1
        
return 1
    
endif    
else
    return 
0
endif 

you can use reflection_check and custom_spell_check functions im using them over one year because im using custom spell effects for necromancy and magery. but you need to create your own custom_fire_effect function because its just for one spell and i created it as an example. for larger use you need to create defnames like:

[defname custom_magics]
custom_magic_18_multip 150
custom_magic_18_damage_type dam_fire

then you can use spell number as an argument and use it in function. after that you can call them in your scripts and you can use one function for all spells. and when you need to change power etc. of a spell you can just edit the defnames without messing with the scripts.
(This post was last modified: 12-14-2012 07:03 PM by Shaklaban.)
12-14-2012 06:58 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Will this work, and how to short it down - Shaklaban - 12-14-2012 06:58 PM

Forum Jump:


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