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
Jonaleth
Apprentice
*

Posts: 42
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Apr 2012
Reputation: 0



Post: #1
Problem with custom spells...
Any idea why this doesn't work;

[SPELL 121]
DEFNAME=s_healI
NAME=Heal
SOUND=snd_spell_heal
RUNES=
CAST_TIME=3
RESOURCES=
RUNE_ITEM=
SCROLL_ITEM=
FLAGS=SPELLFLAG_TARG_CHAR | SPELLFLAG_DIR_ANIM | SPELLFLAG_FX_TARG
EFFECT_ID=i_fx_heal_effect
EFFECT=3,15
DURATION=0
MANAUSE=5
SKILLREQ=SKILL_SPIRITSPEAK 40.0
INTERRUPT=100.0,1.0

ON=@Select
IF <mana> > 4
flags=<flags>|020
mana=<mana> + (-5)
RETURN 0
ELSE
RETURN 1
ENDIF

ON=@Success
src.gain_int 60
src.flags=<src.flags>|020

ON=@EFFECT
var0.healingpower=(<eval <src.spiritspeak>>/5)
src.SPELLEFFECT 4, <var0.healingpower>
src.sound=snd_spell_heal
ENDIF

It just tells me that I establish a communication with the spirit world or something. While other spells that has SkillReq: Spiritspeak works just fine. Even if I change the Spiritspeak to Magery, it still establish a communication with the spirit world. I just get confused.
04-25-2012 06:34 PM
Find all posts by this user Like Post Quote this message in a reply
admin phoenix
Master
**

Posts: 354
Likes Given: 1
Likes Received: 23 in 13 posts
Joined: Mar 2012
Reputation: 3



Post: #2
RE: Problem with custom spells...
maybe you have to restart the server and try to set the flag of the skill spiritspeak to SKF_MAGIC
04-25-2012 07:31 PM
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: #3
RE: Problem with custom spells...
(04-25-2012 06:34 PM)Jonaleth Wrote:  Any idea why this doesn't work;

[SPELL 121]
DEFNAME=s_healI
NAME=Heal
SOUND=snd_spell_heal
RUNES=
CAST_TIME=3
RESOURCES=
RUNE_ITEM=
SCROLL_ITEM=
FLAGS=SPELLFLAG_TARG_CHAR | SPELLFLAG_DIR_ANIM | SPELLFLAG_FX_TARG
EFFECT_ID=i_fx_heal_effect
EFFECT=3,15
DURATION=0
MANAUSE=5
SKILLREQ=SKILL_SPIRITSPEAK 40.0
INTERRUPT=100.0,1.0

ON=@Select
IF <mana> > 4
flags=<flags>|020
mana=<mana> + (-5)
RETURN 0
ELSE
RETURN 1
ENDIF

ON=@Success
src.gain_int 60
src.flags=<src.flags>|020

ON=@EFFECT
var0.healingpower=(<eval <src.spiritspeak>>/5)
src.SPELLEFFECT 4, <var0.healingpower>
src.sound=snd_spell_heal
ENDIF

It just tells me that I establish a communication with the spirit world or something. While other spells that has SkillReq: Spiritspeak works just fine. Even if I change the Spiritspeak to Magery, it still establish a communication with the spirit world. I just get confused.

as admin phoenix says if you want to change skillreq, resources etc. of a spell you need to restart the server.
(This post was last modified: 04-25-2012 08:52 PM by Shaklaban.)
04-25-2012 08:51 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Jonaleth
Apprentice
*

Posts: 42
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Apr 2012
Reputation: 0



Post: #4
RE: Problem with custom spells...
But how come this spell wont work while others with Skill_SpiritSpeak works?
04-25-2012 08:56 PM
Find all posts by this user Like Post Quote this message in a reply
Jonaleth
Apprentice
*

Posts: 42
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Apr 2012
Reputation: 0



Post: #5
RE: Problem with custom spells...
I have another question related to New Custom Spells.
I am trying to add custom spells for NPC's, that are working just fine for me. But how can I add them so that NPC's will use them?
I cannot add them to a spellbook or can I?
04-27-2012 06:37 AM
Find all posts by this user Like Post Quote this message in a reply
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #6
RE: Problem with custom spells...
You would have to make a custom book for them or use .cast <spell name here> in some triggers on them with checks and circumstantial variables Tongue. Which you still might have to do with the custom spell book.
04-29-2012 01:26 PM
Find all posts by this user Like Post Quote this message in a reply
Jonaleth
Apprentice
*

Posts: 42
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Apr 2012
Reputation: 0



Post: #7
RE: Problem with custom spells...
Anyone got a simple example of how one can do a costum spellbook. Ive tried a script that tell the npc to .cast s_fart_dart, but he fizzles. He doent have that spell in his spellbook.
So yes a custom spellbook sounds indeed interesting!
04-29-2012 11:07 PM
Find all posts by this user Like Post Quote this message in a reply
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
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #9
RE: Problem with custom spells...
I'd use Cassius' code. It does work. I help on his server sometimes Wink
05-01-2012 11:28 AM
Find all posts by this user Like Post Quote this message in a reply
Jonaleth
Apprentice
*

Posts: 42
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Apr 2012
Reputation: 0



Post: #10
RE: Problem with custom spells...
Thank you! I will use this one Smile very kind of you!
05-04-2012 07:51 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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