isaffected checks
isaffected checks
I want to check the players for having certain spells cast on themselves. From reading the builders help the best bet seems to be
"if isaffected($n) == XXXX"
I can not get this to work currently as it complains that it is checking for an unkown affect, what i think i need is the correct syntax for the right hand side...
Specific spells i am after currently are "True sight" and "invis".
Duranamir
"if isaffected($n) == XXXX"
I can not get this to work currently as it complains that it is checking for an unkown affect, what i think i need is the correct syntax for the right hand side...
Specific spells i am after currently are "True sight" and "invis".
Duranamir
Re: isaffected checks
Have you tried this?
== 'true sight'
"A man may die yet still endure if his work enters the greater work, for time is carried upon a current of forgotten deeds, and events of great moment are but the culmination of a single carefully placed thought." - Chime of Eons
Re: isaffected checks
Actual syntax below.
if isaffected($n) == 'invisibility'
But still complains.
Duranamir
if isaffected($n) == 'invisibility'
But still complains.
Duranamir
- Caelnai
- Sword Grand Master
- Posts: 273
- Joined: Sat Feb 12, 2005 6:03 pm
- Location: Behind that tree...
Re: isaffected checks
wouldn't that be 'invis' ?
Re: isaffected checks
Nope, below does not work either.
if isaffected($n) == 'invis'
if isaffected($n) == 'invis'
-
- Sword Grand Master
- Posts: 787
- Joined: Wed Dec 20, 2006 5:28 pm
- Location: The Frozen North (Canada!)
Re: isaffected checks
It's sort of strange, but I think it ought to work if you try...
if isaffected($n)= invisible
I'm not sure about the true sight, but I'll give a whirl later on with some trial and error.
if isaffected($n)= invisible
I'm not sure about the true sight, but I'll give a whirl later on with some trial and error.
-
- Sword Grand Master
- Posts: 4708
- Joined: Tue Jul 15, 2003 9:26 pm
- Location: House of Wonder, Waterdeep
Re: isaffected checks
What you could try to do is this:
Get a hold of an imm online, cast the required spell, and ask the imm to "mstat" you. The imm should see a line saying "Affected: ..." followed by a series of names. Try using that name.
I would guess that it is
isaffected($n) == invis
isaffected($n) == true_sight
but I'm not 100% sure.
(The whole check is actually nonsensical in its form ... it should be something like "isaffected($n,invis)" instead of using ==)
Get a hold of an imm online, cast the required spell, and ask the imm to "mstat" you. The imm should see a line saying "Affected: ..." followed by a series of names. Try using that name.
I would guess that it is
isaffected($n) == invis
isaffected($n) == true_sight
but I'm not 100% sure.
(The whole check is actually nonsensical in its form ... it should be something like "isaffected($n,invis)" instead of using ==)
Re: isaffected checks
Dalvyn, thanks for the help. Points up an error in the help files as they say..
Duranamirisaffected checks if $whatever is affected by rhs
if isaffected($n) == Detect_magic
Re: isaffected checks
Thanks to everyone for there help. Got it working now. If anyone is interested syntax was correct as per lesson. Values needed were the words invisible and true_sight.
Duranamir
Duranamir
Re: isaffected checks
No problem mate - glad we could set you right!
"This is General Lath'lain Dy'nesir, of the Ebon Spur. Walking Murder surrounded by a thin veneer of civility."
-Miriel
-Miriel
-
- Sword Grand Master
- Posts: 4708
- Joined: Tue Jul 15, 2003 9:26 pm
- Location: House of Wonder, Waterdeep
Re: isaffected checks
Ah, I wasn't suggesting that you should use "isaffected($n, invisible)", just pointing out that the current form (which is the one that works) does not make sense.Duranamir wrote: If anyone is interested syntax was correct as per lesson.
What does not make sense in it is that something written as "isaffected($n)" should have a unique value.
For example, "inroom($n)" is the vnum of the room where $n is ... and thus writing "inroom($n) == 8030" makes sense: it checks that this value IS 8030.
But "isaffected($n)" does not have a single value, and "isaffected($n) == invisible" and "isaffected($n) == true_sight" can both be true at the same time, which ... just does not make sense because something cannot be equal to both "invisible" and "true_sight". But yes, that's the ay it is, currently.
Re: isaffected checks
This is now if isaffected($n) == truesight
"A man may die yet still endure if his work enters the greater work, for time is carried upon a current of forgotten deeds, and events of great moment are but the culmination of a single carefully placed thought." - Chime of Eons