|
Ggoss Apprentice
Joined: 01 Nov 2006 Posts: 114
|
Posted: Wed May 28, 2008 9:39 pm
Need help with this trigger |
basically after i take a certain amount of dmg, i get berserked, and if I flee, i will attack the person/mob in the next room, i want to set it so that if i'm berserked and i flee, that i immediatly kneel.
was thinking something like a yes no variable.
#tr {Your instincts force you into a BloodLust!} {#var berserked "yes"}
#tr {Your blood cools, and you no longer see targets everywhere.} {#var berserked "no"}
that part i'm not sure how to get it to do is the if then statement off the variable berseked =yes or =no
#tr {You flee (%w)!} {#if (@berserked=yes) (kneel)}
Does this seem like it would work? I'm trying to write this for a friend, so can't actually test it in the mud cuz i don't have a character that can do this. |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Wed May 28, 2008 9:46 pm |
If you would do it correctly, yes.
But to clean up your code a bit...
#TRIGGER {Your instincts force you into a Bloodlust!} {#var berserked 1}
#TRIGGER {Your blood cools, and you no longer see targets everywhere.} {#var berserked ""}
#TRIGGER {You flee %w!} {#IF @berserked {kneel}}
The changes I've made: As long as something populates the berserked variable, then it'll always fire "true" (or in your case, yes). Therefore, there's no need for it to equal yes or no. You're not capturing the direction, so no need for parentheses around the %w. You're only using it as a wildcard. All #IF statements are formatted like so: #IF (expression) {true} {false}. The {false} doesn't need to be there if you don't have any actions associated with it. But in your example, you had kneel enclosed in parentheses, not brackets.
Hope this helps.
Charneus |
|
|
|
Toxic Adept
Joined: 27 May 2008 Posts: 299
|
Posted: Wed May 28, 2008 9:46 pm |
Code: |
#TR {Your instincts force you into a BloodLust!$} {#VAR berserked 1}
#TR {Your blood cools, and you no longer see targets everywhere.$} {#VAR berserked 0}
#TR {You flee %w!$} {#IF (@berserked) {kneel}}
|
|
|
|
|
Toxic Adept
Joined: 27 May 2008 Posts: 299
|
Posted: Wed May 28, 2008 9:49 pm |
charneus wrote: |
If you would do it correctly, yes.
#TRIGGER {You flee %w!} {#IF @berserked {kneel}}
All #IF statements are formatted like so: #IF (expression) {true} {false}.
Charneus |
Laff. |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Wed May 28, 2008 9:58 pm |
Not sure what you're "laffing" at. ;) The @berserked doesn't need to be in parentheses. It doesn't hurt to have it that way, but it'll work just fine the way I have it. ;)
Charneus |
|
|
|
Toxic Adept
Joined: 27 May 2008 Posts: 299
|
Posted: Wed May 28, 2008 10:04 pm |
I know, just thought it comical that you stated ALL #IF statements, then totally did something else in your code. I know it will work, but if the person needing help caught it it could be confusing to him.
|
|
|
|
Ggoss Apprentice
Joined: 01 Nov 2006 Posts: 114
|
Posted: Wed May 28, 2008 10:13 pm |
thanks guys, the if statement help files aren't very clear on it, but this works great now.
|
|
|
|
|
|