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
Spells on @gethit
Author Message
Barnabus
Journeyman
*

Posts: 124
Likes Given: 0
Likes Received: 3 in 2 posts
Joined: Apr 2012
Reputation: 1



Post: #6
RE: Spells on @gethit
If we just look at a Spell for example spell number 51 shown below

PHP Code:
[Spell 51]
DEFNAME=s_flamestrike
NAME
=Flame Strike
SOUND
=snd_SPELL_FLAMESTRIKE
RUNES
=KVF
CAST_TIME
=3.5
RESOURCES
=i_reag_spider_silk,i_reag_sulfur_ash
RUNE_ITEM
=i_rune_FLAMESTRIKE
SCROLL_ITEM
=i_scroll_FLAMESTRIKE
FLAGS
=SPELLFLAG_TARG_OBJ|SPELLFLAG_HARMSPELLFLAG_FX_TARGSPELLFLAG_RESIST
EFFECT_ID
=03709
EFFECT
=59
DURATION
=0.0
MANAUSE
=40
SKILLREQ
=MAGERY 80.0
INTERRUPT
=100.0,100.0 

We can see this spell has the flag SPELLFLAG_HARM
This means it will do damage.
The Damage on the spell is the EFFECT.

How do we access this damage from code ? <SERV.SPELL.51.EFFECT>

PHP Code:
ON=@SpellEffect
REF1
=<SERV.UID.<SRC.UID>> // Caster 
REF2=<SERV.UID.<UID>> // Target

// Check if the spell is a harmfull spell
If (<SERV.SPELL.<ARGN1>.FLAGS>&SPELLFLAG_HARM)
    
LOCAL.DAMAGE=<EVAL <SERV.SPELL.<ARGN1>.EFFECT>>
    
SERV.LOG @GETHIT <REF1.NAMEcasts <SERV.SPELL.<ARGN1>.NAMEon <REF2.NAMEdoing <EVAL <LOCAL.DAMAGE>> damage
ELSE
    
SERV.LOG @GETHIT <REF1.NAMEcasts non harmfull spell <SERV.SPELL.<ARGN1>.NAMEon <REF2.NAME>
ENDIF 

Hopefully that should make sense now, if your still confused let me know
(This post was last modified: 10-17-2012 06:01 AM by Barnabus.)
10-17-2012 05:57 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Spells on @gethit - Lano - 10-16-2012, 06:41 AM
RE: Spells on @gethit - Barnabus - 10-16-2012, 07:08 AM
RE: Spells on @gethit - Lano - 10-16-2012, 05:29 PM
RE: Spells on @gethit - Barnabus - 10-17-2012, 12:13 AM
RE: Spells on @gethit - Lano - 10-17-2012, 03:40 AM
RE: Spells on @gethit - Barnabus - 10-17-2012 05:57 AM
RE: Spells on @gethit - Lano - 10-17-2012, 05:11 PM
RE: Spells on @gethit - Lano - 10-18-2012, 03:09 AM
RE: Spells on @gethit - Barnabus - 10-18-2012, 05:56 AM
RE: Spells on @gethit - Skul - 10-18-2012, 07:03 AM
RE: Spells on @gethit - Barnabus - 10-18-2012, 08:17 AM
RE: Spells on @gethit - Lano - 10-18-2012, 05:01 PM

Forum Jump:


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