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
Joe Loop
Apprentice
*

Posts: 23
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Dec 2012
Reputation: 0



Post: #1
Will this work, and how to short it down
Please be gentle i am noobish at this .. i am working on my own elemental system, and right now i am at the part where monsters damage players with spells i want to give elemental damage, based on their spellpower.

[events all humans/players get] <-----

ON=@SpellEffect
REF1=<SERV.UID.<SRC.UID>> // Caster
REF2=<SERV.UID.<UID>> // Target
If (<REF1.magery>>300.0)&&(<argn1>==18) | (<argn1>==28) | (<argn1>==43) | (<argn1>==51) | ((<argn1>==71) | (<argn1>==69)
local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.firemagic=<EVAL <local.firemagic> + rand(22,45)>
local.firemagic=<EVAL <local.firemagic> - <resfire>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>>
ELSE
If (<REF1.magery>>200.0)&&(<argn1>==18) | (<argn1>==28) | (<argn1>==43) | (<argn1>==51) | (<argn1>==71) | (<argn1>==69)
local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.firemagic=<EVAL <local.firemagic> + rand(15,35)>
local.firemagic=<EVAL <local.firemagic> - <resfire>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>>
ELSE
If (<REF1.magery>>150.0)&&(<argn1>==18) | (<argn1>==28) | (<argn1>==43) | (<argn1>==51) | (<argn1>==71) | (<argn1>==69)
local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.firemagic=<EVAL <local.firemagic> + rand(10,35)>
local.firemagic=<EVAL <local.firemagic> - <resfire>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>>
ELSE
REF1=<SERV.UID.<SRC.UID>> // Caster
REF2=<SERV.UID.<UID>> // Target
If (<REF1.magery>>135.0)&&(<argn1>==18) | (<argn1>==28) | (<argn1>==43) | (<argn1>==51) | (<argn1>==71) | (<argn1>==69)
local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.firemagic=<EVAL <local.firemagic> + rand(10,30)>
local.firemagic=<EVAL <local.firemagic> - <resfire>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>>
ELSE
If (<REF1.magery>>99.9)&&(<argn1>==18) | (<argn1>==28) | (<argn1>==43) | (<argn1>==51) | (<argn1>==71) | (<argn1>==69)
local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.firemagic=<EVAL <local.firemagic> + rand(10,25)>
local.firemagic=<EVAL <local.firemagic> - <resfire>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>>
ELSE
If (<REF1.magery>>90.0)&&(<argn1>==18) | (<argn1>==28) | (<argn1>==43) | (<argn1>==51) | (<argn1>==71) | (<argn1>==69)
local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.firemagic=<EVAL <local.firemagic> + rand(10,20)>
local.firemagic=<EVAL <local.firemagic> - <resfire>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>>
ELSE
If (<REF1.magery>>80.0)&&(<argn1>==18) | (<argn1>==28) | (<argn1>==43) | (<argn1>==51) | (<argn1>==71) | (<argn1>==69)
local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.firemagic=<EVAL <local.firemagic> + rand(10,15)>
local.firemagic=<EVAL <local.firemagic> - <resfire>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>>
ELSE
If (<REF1.magery>>70.0)&&(<argn1>==18) | (<argn1>==28) | (<argn1>==43) | (<argn1>==51) | (<argn1>==71) | (<argn1>==69)
local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.firemagic=<EVAL <local.firemagic> + rand(8,15)>
local.firemagic=<EVAL <local.firemagic> - <resfire>>
REF2.CTAG.A_MAGE_DAMAGED_ME_FOR=<EVAL <LOCAL.firemagic>>
ELSE
If (<REF1.magery>>60.0)&&(<argn1>==18) | (<argn1>==28) | (<argn1>==43) | (<argn1>==51) | (argn1>==69)
local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.firemagic=<EVAL <local.firemagic> + rand(7,15)>
local.firemagic=<EVAL <local.firemagic> - <resfire>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>>
ELSE
If (<REF1.magery>>50.0)&&(<argn1>==18) | (<argn1>==28) | (<argn1>==43) | (argn1>==69)
local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.firemagic=<EVAL <local.firemagic> + rand(5,12)>
local.firemagic=<EVAL <local.firemagic> - <resfire>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>>
ELSE
If (<REF1.magery>>40.0)&&(<argn1>==18) | (<argn1>==28)
local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.firemagic=<EVAL <local.firemagic> + rand(4,10)>
local.firemagic=<EVAL <local.firemagic> - <resfire>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>>
ELSE
If (<REF1.magery>>30.0)&&(<argn1>==18) | (<argn1>==28)
local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.firemagic=<EVAL <local.firemagic> + rand(3,8)>
local.firemagic=<EVAL <local.firemagic> - <resfire>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>>
ELSE
If (<REF1.magery>>20.0)&&(<argn1>==18)
local.firemagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.firemagic=<EVAL <local.firemagic> + rand(2,5)>
local.firemagic=<EVAL <local.firemagic> - <resfire>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.firemagic>>
ELSE
If (<REF1.magery>>300.0)&&(<argn1>==20) | (<argn1>==39)
local.poisonmagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.poisonmagic=<EVAL <local.poisonmagic> + rand(25,35)>
local.poisonmagic=<EVAL <local.poisonmagic> - <respoison>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.poisonmagic>>
ELSE
If (<REF1.magery>>200.0)&&(<argn1>==20) | (<argn1>==39)
local.poisonmagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.poisonmagic=<EVAL <local.poisonmagic> + rand(20,25)>
local.poisonmagic=<EVAL <local.poisonmagic> - <respoison>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.poisonmagic>>
ELSE
If (<REF1.magery>>150.0)&&(<argn1>==20) | (<argn1>==39)
local.poisonmagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.poisonmagic=<EVAL <local.poisonmagic> + rand(18,20)>
local.poisonmagic=<EVAL <local.poisonmagic> - <respoison>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.poisonmagic>>
ELSE
If (<REF1.magery>>135.0)&&(<argn1>==20) | (<argn1>==39)
local.poisonmagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.poisonmagic=<EVAL <local.poisonmagic> + rand(14,18)>
local.poisonmagic=<EVAL <local.poisonmagic> - <respoison>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.poisonmagic>>
ELSE
If (<REF1.magery>>99.9)&&(<argn1>==20) | (<argn1>==39)
local.poisonmagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.poisonmagic=<EVAL <local.poisonmagic> + rand(10,14)>
local.poisonmagic=<EVAL <local.poisonmagic> - <respoison>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.poisonmagic>>
ELSE
If (<REF1.magery>>90.0)&&(<argn1>==20) | (<argn1>==39)
local.poisonmagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.poisonmagic=<EVAL <local.poisonmagic> + rand(8,10)>
local.poisonmagic=<EVAL <local.poisonmagic> - <respoison>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.poisonmagic>>
ELSE
If (<REF1.magery>>80.0)&&(<argn1>==20) | (<argn1>==39)
local.poisonmagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.poisonmagic=<EVAL <local.poisonmagic> + rand(6,8)>
local.poisonmagic=<EVAL <local.poisonmagic> - <respoison>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.poisonmagic>>
ELSE
If (<REF1.magery>>70.0)&&(<argn1>==20) | (<argn1>==39)
local.poisonmagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.poisonmagic=<EVAL <local.poisonmagic> + rand(4,6)>
local.poisonmagic=<EVAL <local.poisonmagic> - <respoison>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.poisonmagic>>
ELSE
If (<REF1.magery>>60.0)&&(<argn1>==20) | (<argn1>==39)
local.poisonmagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.poisonmagic=<EVAL <local.poisonmagic> + rand(2,5)>
local.poisonmagic=<EVAL <local.poisonmagic> - <respoison>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.poisonmagic>>
ELSE
If (<REF1.magery>>49.9)&&(<argn1>==20) | (<argn1>==39)
local.poisonmagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.poisonmagic=<EVAL <local.poisonmagic> + rand(1,3)>
local.poisonmagic=<EVAL <local.poisonmagic> - <respoison>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.poisonmagic>>
ELSE
If (<REF1.magery>>300.0)&&(<argn1>==30) | (<argn1>==42) | (<argn1>==49) | (<argn1>==50)
local.energymagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.energymagic=<EVAL <local.energymagic> + rand(15,30)>
local.energymagic=<EVAL <local.energymagic> - <resenergy>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.energymagic>>
ELSE
If (<REF1.magery>>200.0)&&(<argn1>==30) | (<argn1>==42) | (<argn1>==49) | (<argn1>==50)
local.energymagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.energymagic=<EVAL <local.energymagic> + rand(12,20)>
local.energymagic=<EVAL <local.energymagic> - <resenergy>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.energymagic>>
ELSE
If (<REF1.magery>>150.0)&&(<argn1>==30) | (<argn1>==42) | (<argn1>==49) | (<argn1>==50)
local.energymagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.energymagic=<EVAL <local.energymagic> + rand(11,15)>
local.energymagic=<EVAL <local.energymagic> - <resenergy>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.energymagic>>
ELSE
If (<REF1.magery>>135.0)&&(<argn1>==30) | (<argn1>==42) | (<argn1>==49) | (<argn1>==50)
local.energymagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.energymagic=<EVAL <local.energymagic> + rand(10,14)>
local.energymagic=<EVAL <local.energymagic> - <resenergy>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.energymagic>>
ELSE
If (<REF1.magery>>99.9)&&(<argn1>==30) | (<argn1>==42) | (<argn1>==49) | (<argn1>==50)
local.energymagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.energymagic=<EVAL <local.energymagic> + rand(9,12)>
local.energymagic=<EVAL <local.energymagic> - <resenergy>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.energymagic>>
ELSE
If (<REF1.magery>>80.0)&&(<argn1>==30) | (<argn1>==42) | (<argn1>==49) | (<argn1>==50)
local.energymagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.energymagic=<EVAL <local.energymagic> + rand(8,10)>
local.energymagic=<EVAL <local.energymagic> - <resenergy>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.energymagic>>
ELSE
If (<REF1.magery>>70.0)&&(<argn1>==30) | (<argn1>==42) | (<argn1>==49) | (<argn1>==50)
local.energymagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.energymagic=<EVAL <local.energymagic> + rand(5,8)>
local.energymagic=<EVAL <local.energymagic> - <resenergy>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.energymagic>>
ELSE
If (<REF1.magery>>60.0)&&(<argn1>==30) | (<argn1>==42) | (<argn1>==49)
local.energymagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.energymagic=<EVAL <local.energymagic> + rand(4,6)>
local.energymagic=<EVAL <local.energymagic> - <resenergy>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.energymagic>>
ELSE
If (<REF1.magery>>50.0)&&(<argn1>==30) | (<argn1>==42)
local.energymagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.energymagic=<EVAL <local.energymagic> + rand(2,5)>
local.energymagic=<EVAL <local.energymagic> - <resenergy>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.energymagic>>
ELSE
If (<REF1.magery>>40.0)&&(<argn1>==30)
local.energymagic=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
local.energymagic=<EVAL <local.energymagic> + rand(1,3)>
local.energymagic=<EVAL <local.energymagic> - <resenergy>>
REF2.CTAG.A_Mage_Damaged_Me_For=<EVAL <LOCAL.energymagic>>
ENDIF


ON=@gethit
REF1=<SERV.UID.<UID>>
IF <REF1.CTAG0.A_Mage_Damaged_Me_For>
ARGN1=<EVAL <REF1.CTAG.A_Mage_Damaged_Me_For>>
REF1.CTAG.A_Mage_Damaged_Me_For=
ARGN2=dam_god
ARGN3=0
ENDIF


i made out of stuff i found in here on the forums .. but it seems a little stupid and big .. how else to make it smaller but still retain the edibility...

And please dont laugh at it Smile
12-14-2012 08:00 AM
Find all posts by this user Like Post Quote this message in a reply
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
Joe Loop
Apprentice
*

Posts: 23
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Dec 2012
Reputation: 0



Post: #3
RE: Will this work, and how to short it down
fantastic! thats briliant, thank you
12-14-2012 08:48 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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