|
ukitsp Newbie
Joined: 09 Sep 2002 Posts: 8
|
Posted: Mon Sep 09, 2002 8:02 pm
help with some triggers |
I am new to zmud and have tried to create three separate triggers to do the following:-
1. Auto heal once hps gets below a certain value
2. If healing is not enough auto retreat via the direction I entered the room in
3. Auto refreshes the movement of a player
Unfortunately my scripting skills are not very hot (practically non existent) and therefore I have failed miserably. I have searched the forum for help/examples but this does not really help me as I can’t work out how to modify em :( I’m hoping someone can help me out.
Here is the information about the mud:-
When in a battle the stats are displayed as:-
H:xxxx M:xxx V:xxx
The numbers are displayed after every round with the same format, only the numbers are different
My retreat cmd is ‘retreat x’ x being n s e w u d (I also have aliases set up for these (rs,rn,re,rw, etc)
My normal prompt with no loss of stats is: ‘ >’
My heal cmd is ‘cast ‘heal’’ (or ‘hfg’ as an alias) when heal has completed the following msg is displayed:-
‘xxxxx is healed.’ (xxxxx being the name of the chr)
if this fails the msg is ‘ you lose focus’
My refresh cmd is cast ‘heroes feast’ (or ‘hf’ as an alias) When the refresh has completed the following msg is displayed:-
‘You utter the magic words for the spell 'heroes’ feast'
You partake of a magnificent feast!’
if this fails the msg is ‘ you lose focus’
I would like to heal and refresh to the max, when this is done the prompt goes to normal e.g. ‘>’
When I’m about to die the msg is ‘RUN AWAY NOW!
I would be grateful if someone could help me out.
Thx |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Sep 10, 2002 1:38 pm |
#VAR autoheal 1 1;#VAR autorefresh 1 1
#TR {H:(%n) M:(%n) V:(%n)} {#VAR hp %1;#VAR mana %2;#VAR move %3;#IF ((%1 < @lowhp) AND (@autoheal)) {#VAR autoheal 0;hfg} {#IF ((%3 < @lowmove) AND @autoheal AND @autorefresh)) {#VAR autorefresh 0;hf}}} {} {prompt|nocr}
#TR {ukitsp is healed} {#VAR autoheal 1;#VAR autorefresh 1}
#TR {You lose focus} {#VAR autoheal 1;#VAR autorefresh 1}
#TR {You utter the magic words for the spell ~'heroes~’ feast~'} {#VAR autoheal 1;#VAR autorefresh 1}
#TR {^RUN AWAY NOW!$} {retreat @retreat}
You'll need to set @retreat to the direction you want to retreat. Replace "ukitsp" with the name of the character.
LightBulb
Senior Member |
|
|
|
ukitsp Newbie
Joined: 09 Sep 2002 Posts: 8
|
Posted: Tue Sep 10, 2002 3:24 pm |
Hi, thanks for you help.
I have tried your instructions but have been unsuccesful (prolly my fault). Firstly a sytanx error is produced in the following line :-
{#VAR hp %1;#VAR mana %2;#VAR move %3;#IF ((%1 < @lowhp) AND (@autoheal)) {#VAR autoheal 0;hfg} {#IF ((%3 < @lowmove) AND @autoheal AND @autorefresh)) <-(THIS BRACKET){#VAR autorefresh 0;hf}}} {} {prompt|nocr}
I removed the bracket which was then excepted by the trigger - hope this was right !
This didn't make any difference, I tested this by walking until my move was down to 0, and no refresh happened. Does this only work when both hps and move is down, if so is there a way to make them independant of each other (i.e. hps and move seperate)
How do you set the lowest HP damage before a heal is cast
How do you set the lowest movement before a refresh is cast.
I'm also not sure that I explained the prompt in full :( I'll try again, Here is a better example :
If my HPS is down my prompt would be 'H:xxx'
If my move is down my prompt would be 'V:xxx'
if both move and HPS is down the prompt would be 'H:xxx V:XXX'
Regards |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Sep 10, 2002 6:37 pm |
Yes, that was the correct change.
You set the level where a heal spell is cast with the variable @lowhp. You didn't bother to say what numbers you wanted, so I didn't include a statement to do so. Same thing for the refresh spell, using @lowmove.
#VAR lowhp 5000
#VAR lowmove 200
And yes, the prompt changes the whole thing. Try this instead. Change the "low" variables to whatever number YOU want.
#VAR autoheal 1 1;#VAR autorefresh 1 1;#VAR lowhp 5000;#VAR lowmove 200
#TR {H:(%n)} {#VAR hp %1;#IF ((%1 < @lowhp) AND (@autoheal)) {#VAR autoheal 0;hfg}} {} {prompt|nocr}
#TR {V: (%n)} {#VAR move %1;#IF ((%1 < @lowmove) AND @autoheal AND @autorefresh) {#VAR autorefresh 0;hf}} {} {prompt|nocr}
#TR {ukitsp is healed} {#VAR autoheal 1;#VAR autorefresh 1}
#TR {You lose focus} {#VAR autoheal 1;#VAR autorefresh 1}
#TR {You utter the magic words for the spell ~'heroes~’ feast~'} {#VAR autoheal 1;#VAR autorefresh 1}
#TR {^RUN AWAY NOW!$} {retreat @retreat}
The reason I'm checking both @autoheal and @autorefresh before casting the refresh spell is to prevent refresh spells from interfering with heal spells.
LightBulb
Senior Member |
|
|
|
ukitsp Newbie
Joined: 09 Sep 2002 Posts: 8
|
Posted: Wed Sep 11, 2002 9:13 pm |
Thx, Ill give this ago.
One last thing that I missed,
If Mana is down on its own the prompt would be :-
M:xxx
If HPS, move and mana is down the prompt would be :-
H:xxx M:xxx V:xxx
I hope this doesnt put a spanner in the works (sorry if it does)
regards |
|
|
|
ukitsp Newbie
Joined: 09 Sep 2002 Posts: 8
|
Posted: Thu Sep 12, 2002 3:54 pm |
If Hps and mana is down thee prompt would be:-
H:xxx M:XXX
If Mana was down only the prompt would be :-
M:xxx |
|
|
|
ukitsp Newbie
Joined: 09 Sep 2002 Posts: 8
|
Posted: Thu Sep 12, 2002 3:56 pm |
The Retreat works a treat-thx, but I am unable to get the rest to work, could it be something I'm doing or not doing as the case may be ?
Regards |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Sep 13, 2002 5:23 am |
The mana shouldn't affect anything, since the remake used separate triggers, and didn't include one for M:xxx.
As for it not working, I can't see any reason it wouldn't so it's undoubtedly something you either did or didn't do *grin*. Seriously, the most common problem with these kinds of triggers is spacing. H:xxx is different from H: xxx which is different from H: xxx. If the number of spaces in the trigger doesn't match, it doesn't ever do anything (it's not supposed to).
A close look at the revised script will show I left no spaces on the heal trigger and one space on the refresh trigger (oops). They should probably both be the same number of spaces, whether it's 0, 1, 5, or some other number.
LightBulb
Senior Member |
|
|
|
|
|