Help

ATTACKTYPE-BEHAVIOR-EXAMPLE

For immortals

All of the attacktypes are fairly self-explanatory, except perhaps the "behavior" attacktype. Here is an example with Bob! the Test Mob.

medit bob attacktype behavior

Let's say Bob just learned the spell 'acid blast' and boy is he proud of it! In fact, he decides to use it as his regular attack. Here's how it could be done.

mb bob enspelled attack (s 'acid blast' args ^t)
<char>
^&cwound&^2n eagerly shows off his skill with his newly learned acid spell.`n
<room>
^&ccomb&^2n flings a glob of acid at ^n.`n

Well ... suppose, Bob isn't that great of an acid mage, and he really likes to headbutt his victims into submission. With this new code, you can add different regular attacks!

mb bob damager attack
(focus actor type blunt amount 10d3)
<char>
^&cwound&^2n charges into you headfirst!  What an oddball!`n
<room>
^&ccomb&^2n bull charges ^n!  That looks like it hurt!`n

Let's say Bob's less likely to use his acid spell and it comes in lower precedence. So we do this:

mb bob front 2
mb bob triggerp 1 66

So what we end up with is Bob having a 66% chance to do his headbutt attack, but in the event that he does not, he'll proudly swing a glob of goo at his opponent.

Also, attactype behaviors can easily give mobs a variable amount of attacks. To wit:

med bob attack 10
mb bob triggerp 1 50
mb bob triggerp 2 5

Well, this means that for each of his 10 attacks, Bob will have a 50% chance of headbutting, and a 5% chance of acid slinging for each attack that is not a headbutt, giving him an average of 5 attacks per round; but of course, the average won't always be the case and the attacks will be mixed up.