Page 1 of 1
Weapon of Energy
Posted: Sat Aug 17, 2013 9:37 pm
by Orplar
Weapon of Energy
================
Transmutation
Range: Personal
Target: Inventory
Syntax: cast 'weapon of energy' <object> <fire/cold/acid/electricity>
This spell imbues a weapon in the caster's hand with one of four forms of
energy, making it cause energy damage in addition to the weapon's base
damage
* In order to activate the energy with which the weapon is magically imbued,
you must 'use' the weapon subsequent to casting this spell.
This spell cannot be learned by an abjurer
(A) 7th Level Cleric Spells (B) 7th Level Wizard Spells
(C) Magic Domain (D) Transmutation Spells
It appears acid is not an accepted syntax
You are carrying:
a spiked warhammer (perfect)
c 'weapon of energy' spiked acid
You begin to chant.
An expensive diamond glows briefly.
Some gem powder glows briefly.
Syntax is: cast 'weapon of energy' object fire/cold/electricity.
Re: Weapon of Energy
Posted: Sun Aug 18, 2013 3:00 am
by Orplar
also,
Should this remove (glowing) flags?
Re: Weapon of Energy
Posted: Mon Aug 19, 2013 2:09 am
by Raona
Well, this is all in the spell code, and I have to say I'm rather confused by it:
Code: Select all
Affect '
if objtype($o) != weapon then
0
else if string($2) == fire then
L*m
else
0' APPLY_WEAPON_FLAG 'weapon of energy' AFF_BLIND GENERIC_SPELL_FLAG_NORMAL
Affect '
if objtype($o) != weapon then
0
else if string($2) == cold then
L*m
else
0' APPLY_WEAPON_FLAG 'weapon of energy' AFF_INVIS GENERIC_SPELL_FLAG_NORMAL
Affect '
if objtype($o) != weapon then
0
else if string($2) == electricity then
L*m
else
0' APPLY_WEAPON_FLAG 'weapon of energy' AFF_DETECT_MAGIC GENERIC_SPELL_FLAG_NORMAL
End
If I could make sense of what it is up to with the other three, adding acid should not be overly difficult. Was its omission intentional, though?
If anyone understands how the AFF flags chosen make sense...please enlighten me! Something's up, because the spell does work, right? (At least for cold, fire, and electricity?)
This spell should not strip glowing flags, if it does so that may be a hard code issue. Is it permanent, or just for the duration of the spell?
Re: Weapon of Energy
Posted: Mon Aug 19, 2013 2:40 am
by Gwain
It is permanent. I lost a glow flag on a weapon. I had to restore it.
Re: Weapon of Energy
Posted: Mon Aug 19, 2013 2:48 am
by Orplar
The glow flag removal has been permanent, unless Im just bonkers and that is likely. All other aspects of the item have stayed the same. Havent tried re adding the flag and testing again as i lack bright stones at the moment. Fire/cold/electricity all work beautifully.
Re: Weapon of Energy
Posted: Mon Aug 19, 2013 1:52 pm
by Raona
Right, moving to confirmed. I'm going to need help figuring this one out, though, sorry!
Re: Weapon of Energy
Posted: Mon Aug 19, 2013 3:29 pm
by Algon
Would there by a way to add an if check to see if the item is glowing before the actual spell takes place, and then just re-add the glow flag at the end of the spell?
Re: Weapon of Energy
Posted: Tue Aug 20, 2013 1:48 am
by Raona
Honestly, I don't understand the spell code up above (I don't see how the spell should work at all, but it does!) and I don't see how it should strip a flag (at least not a glowing flag) even if it acted the way I would naively expect it to based on the above. So there's either some hardcode at work that I can't see, or I need some tutoring on this aspect of the spell code. I'm wondering if the bit correspondencies didn't get messed up when new affects were brought in for the elemental flags.
Re: Weapon of Energy
Posted: Mon May 12, 2014 11:18 pm
by Althasizor
Giving this a little nudge, because this spell permanently removing flags is still an issue. I used it a few minutes ago, and while it didn't remove the glowing flag on my weapon, it did remove the more fun and less replaceable (Humming) flag.
Before: <right hand> (Glowing) (Humming) a black warhammer (perfect)
During: <right hand> (Glowing) (Humming) (Icy) a black warhammer (perfect)
After: <right hand> (Glowing) a black warhammer (perfect)
Re: Weapon of Energy
Posted: Tue May 13, 2014 12:05 am
by Gwain
Yes, I think the different flags are stripping other flags, fire tends to remove glowing, and ice will probably take the humming.
Re: Weapon of Energy
Posted: Tue May 13, 2014 3:02 am
by Raona
Canon has this spell only offering electricity, fire, and ice as options, so I've stripped acid from the helpfile; I think that was just a typo.
As for the flag stripping, that's a knottier bit of tree. Working on it.
Re: Weapon of Energy
Posted: Wed May 14, 2014 9:07 am
by Raona
Gwain wrote:Yes, I think the different flags are stripping other flags, fire tends to remove glowing, and ice will probably take the humming.
Gwain's right on the mark, here. An active flaming flag will remove the glowing flag when it expires, and an active icy flag will remove the humming flag when it expires. I suspect this is in hardcode, as even the spell code flag modifications don't make any sense to me, but I will try fiddling with them.