|
Farek Beginner
Joined: 13 Oct 2004 Posts: 29
|
Posted: Mon Jun 25, 2007 10:57 am
Problem with trigger firing off twice. |
A Small Passage
Obvious exits: [North, East, South]
Prdel the Half-Elf (invisible) (sanctuary) is here, fighting The greater medusa.
The greater medusa is here, fighting Prdel.
retreat
cast 'Circle Of Protection'
...glowing with a bright light!
The thessalhydra is here, fighting Prdel.
retreat
cast 'Circle Of Protection'
Trigger:
is here, fighting %w.$
Value:
#if (@CopUp != 1 & (@AutoCop = 1 | @AutoCop = 2)) {
retreat
cast 'Circle Of Protection'
}
So what can i do to make it just toss one circle of protection even if its 10 agg mobiles in the room? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Jun 25, 2007 11:09 am |
#alias OnRoomEnter {#t+ CoP}
(or, if you don't use the mapper, make a trigger that'll fire when you enter a room and not on anything else)
Then give the protection trigger the ID CoP (there's a box in the editor for it) add the command "#t- CoP" to the trigger's commands. |
|
|
|
Farek Beginner
Joined: 13 Oct 2004 Posts: 29
|
Posted: Mon Jun 25, 2007 11:27 am |
that wont help since i dont use mapper and i dont want to cop all rooms. just the rooms where aggies are.
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Jun 25, 2007 12:06 pm |
It'll work fine if there aren't aggro mobs in the room because all the alias does is turn the trigger back on when you move into a new room. Then the trigger will be on until the next time it casts CoP - when it does that, it'll disable itself until you change room, at which point the alias will turn the trigger back on.
Try something like this instead:
#trig {^Obvious exits: ~[*~]$} {#t+ CoP} |
|
|
|
Farek Beginner
Joined: 13 Oct 2004 Posts: 29
|
Posted: Mon Jun 25, 2007 12:41 pm |
The problem with that trigger is it will cast cop in EVERY room.
I want to to cast one single cop in a room with agg mobile in it.
If its a room without aggies it wont toss cops at all. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Jun 25, 2007 4:43 pm |
Unless I'm misinterpreting your problem, it shouldn't be. Perhaps you're misunderstanding how the #t+ and #t- commands work - they enable or disable checking for a particular trigger. Once you've used #t- on a trigger, it won't fire again until you use the #t+ command, and then it'll be able to fire again. It won't fire when you use the #t+ command, but zMUD will start checking it against text coming from the mud again.
So what happens is you enter a room and the obvious exits trigger is turned on. Then the trigger is checked as the rest of the room description, including the mobs, is received - if there are aggro mobs there, it'll CoP but if there aren't, then it won't. It shouldn't be firing for every room. Once the trigger detects an aggro mob, it'll turn itself off. It'll only be enabled again when something turns it on - that is, the obvious exits trigger when you next enter a room. |
|
|
|
Dharkael Enchanter
Joined: 05 Mar 2003 Posts: 593 Location: Canada
|
Posted: Mon Jun 25, 2007 4:48 pm |
Farek if you, as Fang Xianfu suggested, create an exit trigger to turn on the COP trigger;
and have the COP trigger turn itself off as the first command before it cast 'Circle Of Protection' everything should be fine.
When you enter a room the trigger turns itself on as soon as it sees exists,
then disables itself from firing again as soon as it gets triggered.
This should meet your requirements shouldn't it?
EDIT:Fang's too quick on the draw, This post is redundant now :p |
|
_________________ -Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style." |
|
|
|
Farek Beginner
Joined: 13 Oct 2004 Posts: 29
|
Posted: Mon Jul 02, 2007 10:38 pm |
Its working thanks for the help :)
|
|
|
|
|
|