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
Problem with custom spells...
Author Message
Anarch Cassius
Master
**

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



Post: #8
RE: Problem with custom spells...
Code:
[FUNCTION npccast]
// Determine spell and skill used to cast
LOCAL.SPELL = <EVAL <ARGV[0]> &~ 0ff000000>
LOCAL.SKILL = <EVAL (<STREAT <SERV.SPELL.<LOCAL.SPELL>.SKILLREQ>>) &~ 0ff000000>
IF (<SERV.SPELL.<LOCAL.SPELL>.MANAUSE> > <MANA>)
    RETURN 1
ENDIF
IF (<EVAL STRLEN(<SERV.SPELL(<LOCAL.SPELL>).RUNES>)> > 0)
     SAY <RUNES <LOCAL.SPELL>>
ENDIF
IF !(<LOCAL.SKILL>)
  LOCAL.SKILL = 25
ENDIF
TAG.LASTCASTING=<eval (<SERV.TIME>+<SERV.SPELL.<LOCAL.SPELL>.CAST_TIME>)>
TAG.SPELLCASTING=<LOCAL.SPELL>

// Set spell target
IF (<ARGV> > 2) //use coords if given
    ACT = 0
    ACTP = <ARGV[1]>, <ARGV[2]>, <ARGV[3]>, <ARGV[4]>
ELIF (<SERV.SPELL.<LOCAL.SPELL>.FLAGS> & spellflag_targ_xyz) //use coords for ground targ spells regardless
    ACTP = <ACT.P>
    ACT = 0
ELSE
    REF1 = <ARGV[1]>
    IF !(<REF1.UID>)
        REF1 = <ACT.UID>
        IF !(<REF1.UID>)
            REF1 = <UID>
        ENDIF
    ENDIF
    ACT = <REF1.UID>
    ACTP = <REF1.P>
ENDIF

    
// Set character action
ACTPRV = <UID>
ACTARG1 = <LOCAL.SPELL>
ACTION = <LOCAL.SKILL>
RETURN 1

You can't just use CAST, it needs a target. This function works with objects or coordinates.

Code:
npccast s_fart_dart,<act>
04-30-2012 06:23 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Problem with custom spells... - Jonaleth - 04-25-2012, 06:34 PM
RE: Problem with custom spells... - Khaos - 04-29-2012, 01:26 PM
RE: Problem with custom spells... - Anarch Cassius - 04-30-2012 06:23 AM
RE: Problem with custom spells... - Khaos - 05-01-2012, 11:28 AM

Forum Jump:


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