Welcome to the Builder Academy

Question Trigger of the Day - Mob Speech Example

More
29 Mar 2013 12:18 #1746 by Rumble
Code:
Name: 'Mob Speech and Expressions Example', VNum: [ 63], RNum: [ 63] Trigger Intended Assignment: Mobiles Trigger Type: Speech , Numeric Arg: 1, Arg list: * Commands: * By Rumble of The Builder Academy tbamud.com 9091 * Arg list * means it will fire whenever someone talks. * Check if it is a player character (not a mob). if %actor.is_pc% wait 1 sec * Check the actors sex. if %actor.sex% == male say Good day sir, what would you like? elseif %actor.sex% == female wait 1 sec say Good day maam, what can I get you? else say What do you want? end * Check if the player level is less than 10 (9 and lower). if %actor.level% < 10 say you are a player below level 10. else say you are not below level 10. end * Check class not equal to warrior. if %actor.class% != warrior say you are not a warrior. else say you are a warrior. end * Check alignment between 350 and -350 (neutral). if %actor.align% <= 350 && %actor.align% >= -350 say you are neutral. else say you are not neutral. end * Check strength greater than or equal to 16 and less than or equal to 18. (16-18) * If this was done without the equalities (=) it would check str 17 only. if %actor.str% >= 16 && %actor.str% <= 18 say your strength is 16-18. else say your strength is not 16-18. end * Check the speech to see if it is a substring of the word concatenated. * concaten caten cat and any abbreviations. if concatenated /= %speech% say your speech was a substring of concatenated. else say your speech was not a substring of concatenated. end * Create a random number 1-10 and assign it to rnumber. set rnumber %random.10% say your random number is: %rnumber% * increment it by 1. set rnumber %rnumber% + 1 say your incremented random number is: %rnumber% else say you are not a player. end
If this was helpful please vote or leave a review for TBA.

Rumble
The Builder Academy
tbamud.com 9091
rumble@tbamud.com

Please Log in or Create an account to join the conversation.

Time to create page: 0.161 seconds