home » builders » builder's lessons » speech prog
Speech programs
Speech programs are triggered by a keyword or a key phrase that is used in says or sayto.
>speech_prog ondil ondils ondil's~ if quest(14, 4, $n) == 1 mpecho The lich throws back his head and laughs insanely. sayto $n So you seek Ondil's Book of Spells? You will have sayto $n to battle me for that information, and if you win sayto $n I may tell you. mpmset $n quest 14 4 2 mpkill $n endif ~ |
In this prog a PC saying any of the words, ondil, ondils or ondil's will trigger this prog. The prog then checks the quest bits on the PC before doing some sayto's, an echo and setting up the quest another bit. After this the mobile attacks the PC with the mpkill command. You will notice that often normal commands in mob progs are preceeded by an mp. You must use the mp version of the command in mob progs. If there is variations on saying a particular word then it is good practice to put in those variations as has been done with the word ondil.
The following prog is not triggered on a keyword but rather a phrase. When using a phrase, it is preceeded by a p. This means the PC must say the exact phrase, including punctuation and case. This is a much harder quest to do, so at some point your quest should have given a good clue of what to say.
>speech_prog p Arilyn sent me~ if quest(0, 5, $n) == 7 nod $n sayto $n Arilyn wants the help of the Lythari? sayto $n I will take you to the Lythari elders. mptransfer $n 15263 mpgoto 15263 mpechoat $n You feel odd as you go between worlds. mpforce $n look endif ~ |
This is the prog from the lythari in the elf quest in Tethir Forest. The player must say the phrase Arilyn sent me exactly. No change in case, no change in punctuation. I actually have this prog repeated with a few different variations on the phrase to make it easier for players. Once the phrase is said this quest checks the quest bits of the PC. Talks to the PC and then transfers them to a room in the lythari den. Mptransfer transfers the PC only. If you want $n's pet to go as well you need to add the argument pet. To do that it would have to be mptransfer $n pet. It will not transfer whole groups. To do that it would have to be mptransfer all. The mob then follows the player with an mpgoto and forces the player to look. This is important. You can actually do a mptransfer and the player has no idea that it has happened. Helpful in some quest situations, but if you want the PC to know they have moved you have to mpforce them to look. If you are ever testing a quest with an imm character on the test port, bare in mind that mobs cannot force an immortal. Therefore testing is best done with a mortal.