If checks on fight progs

For builders to discuss and ask building questions.
Post Reply
Elwin
Sword Master
Sword Master
Posts: 171
Joined: Wed Dec 31, 2003 8:28 pm
Location: Ardeep
Contact:

If checks on fight progs

Post by Elwin » Thu Mar 24, 2005 4:40 pm

I had a question about fight progs. Now, in all of the examples, the mobs have "if quest" checks put on them. I was wondering if the if checks are actually required or if they can be left oout of the prog. Any help would be gratly appreciated.
From your friendly neighborhood ranger :)
Dalvyn
Sword Grand Master
Sword Grand Master
Posts: 4708
Joined: Tue Jul 15, 2003 9:26 pm
Location: House of Wonder, Waterdeep

Post by Dalvyn » Thu Mar 24, 2005 5:52 pm

No, you can have fight progs with no if-checks. For example :

Code: Select all

>fight_prog 40~
mpecho $I spits murky waters into $N's eyes!
mpcast blindness $n
~

This is actually a disguised if-checks, since it does the same as

Code: Select all

>fight_prog 100~
if rand(40)
  mpecho $I spits murky waters into $N's eyes!
  mpcast blindness $n
endif
~
Most fight-progs have if-checks though, because if-checks combined with rand(...) allow us to make the mob's behaviour "random": the mob "chooses" an action amongst several possibilities.
Image
Post Reply