|
Nickman Beginner
Joined: 26 Feb 2003 Posts: 15
|
Posted: Sat Mar 27, 2004 12:08 pm
I need help with conditions |
To the mud that im playing we have the option to skinn the corpse and make some items (helm/sleeves/boots/cloak/leggings/helm) and in some cases those items can get one or more bonus stats.
The general message is <Your expert craftsmanship adds luck to Some Sleeves skinned from Tabaxi Warrior.> (but there is another 2-3 like this one and is possible the same item get more than one stats so at this case we have at least 2 times a message like that).
I was trying to make a condition if the skinned item get one (or more) bonus stat then give the command preserve itemname and keep itemname. If the item is only a skinned one without any bonus then drop itemname.
Can anyone give me some general guidance how can i do that? |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Sat Mar 27, 2004 10:21 pm |
how about a lil mud output of you skinning makeing non keep items and keep items and using the commands to keep / drop the item
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Mar 28, 2004 5:04 am |
Best I can do with the information provided.
#TR {Your expert craftsmanship adds %w to Some (%w) skinned from} {preserve %1;keep %1}
#COND {Your expert craftsmanship adds %w to Some %w skinned from} {#NOOP} {Within|Param=1}
#COND {Your expert craftsmanship adds %w to Some %w skinned from} {#NOOP} {Within|Param=1} |
|
|
|
Nickman Beginner
Joined: 26 Feb 2003 Posts: 15
|
Posted: Mon Mar 29, 2004 11:07 am |
Ohh yes .. lack of info is very bad :))
I have a trigger that checks when the mob dies and then it fires
skin %item( @skinns, %random( 1, 6)) corpse
the var @skinns contains the kind of the item (sleeves/helm e.t.c.)
If the skin is successfull and the item getting stats i get a message like
You make yourself A Helm skinned from Tabaxi hunter.
Your expert craftsmanship adds intelligence to A Helm skinned from Tabaxi hunter.
Your expert craftsmanship adds hitroll to A Helm skinned from Tabaxi hunter
Your expert craftsmanship adds damroll to A Helm skinned from Tabaxi hunter.
Your expert craftsmanship adds dexterity to A Helm skinned from Tabaxi hunter.
Or if the skinn is a simple one without any stats on it we got a message like
You make yourself Some Leggings skinned from the mortal manifestation of Goddess Icaza.
If you want to keep this item, don't forget to 'preserve' it.
I was trying to make a condition for those two cases.
at first case to send the commands preserve itemname and keep itemname (but not for every stat that added)
and at second case just drop itemname.
p.s.
i was trying to find at help the #NOOP command that lightbulb gave me but i dodnt find anything .. what that do?
Regards
Nick. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Mon Mar 29, 2004 12:39 pm |
The #NOOP command does nothing. It stand for NO OPeration.
Since the line that comes after the one that tells you that you made the item may be different depending on if the item got any stats, then you can capture this line and check what it contains:
#TRIGGER {You make yourself %w (%w) from *.$(*)} {#IF ("%2" = "If you want to keep this item, don't forget to 'preserve' it.") {drop %1} {preserve %1;keep %1}} |
|
|
|
Nickman Beginner
Joined: 26 Feb 2003 Posts: 15
|
Posted: Mon Mar 29, 2004 1:00 pm |
At this case the "%2" that is next to IF is checking for the line to see if the words <If you want to keep this item ... > are next to <You make yourself ...> ??
|
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Mon Mar 29, 2004 4:14 pm |
Not next to, but on the line right after that one. The $ in the pattern tells zMUD to match the end of the line. What this means is that whatever is after the $ in the pattern (if anything) will appear in the next line. For example, consider this MUD output:
Kjata enters the room.
Kjata walks west.
You can match these two line with just one trigger like this one:
#TRIGGER {Kjata enters the room.$Kjata walks west.} {...}
If I want to just get the next line after some specific text, then it can be captured with a wildcard:
#TRIGGER {Kjata enters the room.$(*)} {#SAY The next line after the message was: %1} |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Mar 29, 2004 7:00 pm |
I was using #NOOP so that if you had a second (or third) improvement on the same item, you wouldn't reverse the 'keep' from the first improvement. That approach was based on the information from your first post.
After your second post, it's clear that dropping the unwanted items, and preserving/keeping everything else, is better. |
|
|
|
|
|