>speech_prog "test 1"
if iscarrying($n) == 154
else
if iscarrying($n) == 14
if iscarrying($n) == 1011
if iscarrying($n) == 15
if iscarrying($n) == 20
mpforce $n give arm Slooguntitsu
mpjunk arm
mpforce $n give leg Slooguntitsu
mpjunk leg
mpforce $n give wood Slooguntitsu
mpjunk wood
mpforce $n give mushroom Slooguntitsu
mpjunk mushroom
mpoload 151
give crystal $n
endif
endif
endif
else
mea $n Slooguntitsu says "You do not have the items! Go get them!"
endif
endif
If I have the wood, arm and leg, and say the syntax, the mob will do nothing at all.
>speech_prog "I have the items"
if iscarrying($n) == 154
else
if iscarrying($n) == 14
if iscarrying($n) == 1011
if iscarrying($n) == 15
if iscarrying($n) == 20
mpforce $n give arm Slooguntitsu
mpjunk arm
mpforce $n give leg Slooguntitsu
mpjunk leg
mpforce $n give wood Slooguntitsu
mpjunk wood
mpforce $n give mushroom Slooguntitsu
mpjunk mushroom
mpoload 151
give crystal $n
endif
endif
endif
else
mea $n Slooguntitsu says "You do not have the items! Go get them!"
endif
endif
Meh. This is ugly formatting. Let us do it the Python way to show you your problem:
>speech_prog "I have the items"
if iscarrying($n) == 154
else
> if iscarrying($n) == 14
if iscarrying($n) == 1011
if iscarrying($n) == 15
if iscarrying($n) == 20
mpforce $n give arm Slooguntitsu
mpjunk arm
mpforce $n give leg Slooguntitsu
mpjunk leg
mpforce $n give wood Slooguntitsu
mpjunk wood
mpforce $n give mushroom Slooguntitsu
mpjunk mushroom
mpoload 151
give crystal $n
endif
endif
endif
else
mea $n Slooguntitsu says "You do not have the items! Go get them!"
endif
endif
If you look at the program, I think the last else is tied to the if statement that I marked with an ">". Your problem should be there.
Test your program out without whatever object is vnum 14. If it displays the correct error message, then you have a problem with the logic of the code.
SMAUG mobprogs are extremely limited. If you go look at the code, you'll see that it's not really a programming language at all. There is an 'or' but I don't believe there's an 'and'.
I realize this is an old post and you've probably already discovered your mistakes by now. Still, it turned up in my search from Google, so I'll go ahead and answer it.
The way your original program is written, you will only get the success actions if you have ALL 4 items, and you will only get the fail message if you are missing the item numbered 14.
I'm not terribly familiar with mob progs, but if you put the else mea ... after each if clause and then break, it should work. This means a total of 4 else statements, not counting the first one.
The other possibility is if mob progs have a negation ability, so that you could ask if a player doesn't have 14, or a player doesn't have 1011, or ... then fail else success.