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
Custom spells and rune_item
Author Message
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #1
Custom spells and rune_item
Take the case i'm scripting a new invisibility spell. I want it to equip i_rune_invisibility as a memory. How can i do it?
Setting proper RUNE_ITEM, DURATION and LAYER don't make the spell create or equip the item. Also, the i_rune_invisibility has LAYER=0 and TYPE=t_spellicon, i can change the type to t_spell but not the layer, so i can't equip it. Funny thing is that the i_rune_invisibility created by the hardcoded spell s_invisibility has LAYER=39 (the one i set as spell's layer).
01-23-2016 06:19 AM
Find all posts by this user Like Post Quote this message in a reply
Kanibal
Master
**

Posts: 255
Likes Given: 6
Likes Received: 30 in 28 posts
Joined: Jun 2012
Reputation: 0



Post: #2
RE: Custom spells and rune_item
Code:
[ITEMDEF i_rune_invisibility]
DEFNAME=i_rune_invisibility
ID=i_memory
TYPE=t_eq_script

ON=@Equip
src.invis

Grandmaster Localhost Admin
01-23-2016 06:32 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #3
RE: Custom spells and rune_item
Why would i redefine that item? Also i'm not sure i can do it, i can instead edit the script of i_rune_invisibility, or change after creation the type to t_eq_script. By the way, i don't want to change the script, if possible, i am interested rather in making the thing work like the hardcoded one without changing anything, i'm pretty sure i'm missing something.
01-23-2016 07:41 AM
Find all posts by this user Like Post Quote this message in a reply
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #4
RE: Custom spells and rune_item
Solved by doing this:
Code:
SERV.NEWITEM i_rune_invisibility
NEW.ATTR=026
NEW.MORE2=01
NEW.MOREX=2531 //custom spell number
NEW.TYPE=t_spell
NEW.LAYER=layer_spell_invis
NEW.CONT=<UID>

Anyways, i'm still wondering how can i make it work with RUNE_ITEM,DURATION and LAYER.
01-23-2016 06:25 PM
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: #5
RE: Custom spells and rune_item
Now sure if Layer property is RW off the top of my head. You might just have to change the base script or replicate it and do your own layer in the main definition.

Code:
[itemdef i_rune_new_invis]
id=i_rune_invisibility
type=t_eq_object
layer=layer_special

category=Magic
subsection=Runes: New Runes
description=Invisibility Rune (New)

Let me know what is going on. If I am wrong and layer is indeed changeable in game (I don't think it is), it could be the spell code is forcing a layer change (I doubt it though).
02-19-2016 12:27 PM
Find all posts by this user Like Post Quote this message in a reply
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #6
RE: Custom spells and rune_item
In game it isn't changeable, but the code i wrote works, so maybe you can change it before the positioning in the world.
02-19-2016 06:49 PM
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: #7
RE: Custom spells and rune_item
Yeah, it is as I thought then. Layer's aren't RW in game, just R. Which makes sense. Super happy you figured this out and have it working. ^_^ Always trying to help when/where I can.
02-19-2016 07:53 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Khaos's post
Post Reply 


Forum Jump:


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