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
Issue with custom spell
Author Message
kstanton03
Apprentice
*

Posts: 2
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Dec 2016
Reputation: 0



Post: #1
Issue with custom spell
I wrote a script for a regen spell. It's still in the early stages. The script works fine when a player targets themselves; however, if the player target's another player the timer equips to the caster and not the person being casted on. Any help / suggestions would be appreciated.


[Spell 200]
DEFNAME=s_regen_rank1
NAME=Regen
SOUND=snd_SPELL_GREATER_HEAL
RUNES=IVM
CAST_TIME=0
RESOURCES=
RUNE_ITEM= //i_rune_GREATER_HEAL
SCROLL_ITEM=i_scroll_GREATER_HEAL
FLAGS=SPELLFLAG_TARG_CHAR|SPELLFLAG_FX_TARG|SPELLFLAG_GOOD|spellflag_playeronly

ON=@Start
ANIM 17
SAY @,3,1 Casting Regen

ON=@Effect
local.healpower=12
local.spelltics=5

IF (<TAG0.BUFFS.REGEN>)
src.sysmessage That character already has this spell in effect.
return 1
else //NO BUFF ON
src.tag.mp -= 19
SERV.NEWITEM i_timer_regen
NEW.TAG.HEALPOWER=<local.healpower>
NEW.TAG.TICSLEFT=<local.spelltics>
NEW.EQUIP
tag.buffs.regen=<local.healpower>
RETURN 1
end if

return 1


[ITEMDEF i_timer_regen]
ID=i_memory
TYPE=t_eq_script

ON=@Create
TIMER = 3

ON=@Timer

if (<tag.TICSLEFT> < 1)
cont.TAG.BUFFS.REGEN=
REMOVE
return 1
end if

if (<cont.flags>&statf_dead)
cont.TAG.BUFFS.REGEN=
REMOVE
RETURN 1
end if

CONT.EFFECT=3,01153 ,9,30,1, 03e

if (<cont.tag.hp> < <cont.tag.maxhp>)
cont.tag.hp += <tag.HEALPOWER>
end if

if (<cont.tag.hp> > <cont.tag.maxhp>)
cont.tag.hp = <cont.tag.maxhp>
end if

local.newhits = ((<cont.tag.hp>*100) / <cont.tag.maxhp>)
cont.HITS = <local.newhits>

TAG.TICSLEFT -= 1
//cont.sysmessage You have <eval <tag.TICSLEFT>> tics to go.
//cont.say I got healed for <eval <tag.healpower>>
TIMER 3
RETURN 1
03-19-2017 06:08 AM
Find all posts by this user Like Post Quote this message in a reply
Leonidas
Master
**

Posts: 277
Likes Given: 3
Likes Received: 13 in 12 posts
Joined: May 2013
Reputation: 1



Post: #2
RE: Issue with custom spell
Tried testing this on my server and it wouldn't work even when targetting myself. I'd think all youd have to do is change it like this:

Code:
src.TARG.tag.mp -= 19
SERV.NEWITEM i_timer_regen
NEW.TARG.TAG.HEALPOWER=<local.healpower>
NEW.TARG.TAG.TICSLEFT=<local.spelltics>
NEW.TARG.EQUIP
tag.TARG.buffs.regen=<local.healpower>

But I can't test it so I have no idea if that'll work.
03-19-2017 01:59 PM
Find all posts by this user Like Post Quote this message in a reply
kstanton03
Apprentice
*

Posts: 2
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Dec 2016
Reputation: 0



Post: #3
RE: Issue with custom spell
Thanks for the reply,
By mistake I cut out this part of the [Spell 200]
SKILLREQ=MAGERY 0
INTERRUPT=0,0

I tested with the NEW.TARG, however it gives me a console error of undefined keyword TARG.EQUIP. I have tried to utilize TARG in both on=@start and on=@effect. My option may have to be to keep the timer on the player who casts the spell and store the target's UID in the timer. Things definitely work a lot different when written under a spell rather than a function.
03-19-2017 07:13 PM
Find all posts by this user Like Post Quote this message in a reply
Artyk
Journeyman
*

Posts: 75
Likes Given: 43
Likes Received: 9 in 9 posts
Joined: Sep 2014
Reputation: 0



Post: #4
RE: Issue with custom spell
I think the matter is "NEW.EQUIP" since that equips to the SRC, and in that case is the character responsible for the spell.
03-21-2017 07:57 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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