Making Mobile Programs |
MANUAL FOR MOBPROGS ON ANSALON and ROM 2.4 FROMAnsalon
http://www.ansalonmud.com http://ansalon.wolfpaw.net telnet://ansalonmud.com:8679 telnet://ansalon.wolfpaw.net:8679 telnet://204.209.44.23:8679 Version 2.3.4 September 28 2008 The object of this document is to help you avoid some of the pitfalls that many beginning mprog'ers make, myself heavily included. It exists to be a definitive guide to making mobile programs. - Skol
| CODE EDITOR | |
| .r 'old' 'new' | - replace a substring (requires '', "") |
| .r OLD NEW | - Swap a word for a new one |
| .h | - get help (this info) |
| .s | - show string so far |
| .f | - Format (word wrap) string |
| .c | - clear string so far |
| .ld # | - delete line number # |
| .li # (str) | - insert (str) at line # |
| .lr # (str) | - replace line # with (str) |
| @ | - end string |
| done | - exits editor (make sure you exit the code editor with '@' first) |
| VARIABLE | MOBILE | ACTOR | VICTIM | RANDOM | OBJECT | 2ND_OBJECT |
| name | $i | $n | $t | $r | $o | $p |
| shrt_desc/title | $I | $N | $T | $R | $O | $P |
| he/she/it | $j | $e | $E | $J | -- | -- |
| him/her/it | $l | $m | $M | $L | -- | -- |
| his/hers/its | $k | $s | $S | $K | -- | -- |
| a/an | -- | -- | -- | -- | $a | $A |
| VARIABLE | Explanation |
| $i | - the first of the names of the mobile itself. |
| $I | - the short description of the mobile itself. |
| $n | - the name of whomever caused the trigger to happen. |
| $N | - the name and title of whomever caused the trigger to happen. |
| $t | - the name of a secondary character target (i.e A smiles at B) |
| $T | - the short description, or name and title of target (NPC vs PC) |
| $r | - the name of a random PC in the room with the mobile |
| $R | - the short description, or name and title of the random PC |
| $q | - the name of the MOB PROGRAM target (see MOB REMEMBER) |
| $Q | - the short description of the MOB PROGRAM target |
| $j | - he,she,it based on sex of $i. |
| $e | - he,she,it based on sex of $n. |
| $E | - he,she,it based on sex of $t. |
| $J | - he,she,it based on sex of $r. |
| $k | - him,her,it based on sex of $i. |
| $m | - him,her,it based on sex of $n. |
| $M | - him,her,it based on sex of $t. |
| $K | - him,her,it based on sex of $r. |
| $l | - his,hers,its based on sex of $i. |
| $s | - his,hers,its based on sex of $n. |
| $S | - his,hers,its based on sex of $t. |
| $L | - his,hers,its based on sex of $r. |
| $o | - the first of the names of the primary object (i.e A drops B) |
| $O | - the short description of the primary object |
| $p | - the first of the names of the secondary object (i.e A puts B in C) |
| $P | - the short description of the secondary object |
| Variable | Argument | Meaning |
| status | if status $1 3 | - is the PC's status == 3 |
| pc_str | if pc_str $n >= 14 | - is the PC's strength >= 14 |
| pc_int | if pc_int $n <= 14 | - is the PC's intelligence <= 14 |
| pc_wis | if pc_wis $n == 14 | - is the PC's wisdom 14 |
| pc_dex | if pc_dex $n > 14 | - is the PC's dexterity > 14 |
| pc_con | if pc_con $n < 14 | - is the PC's constitution < 14 |
| pc_permstr | if pc_permstr $n >= 14 | - is the PC's PERM strength >= 14 |
| pc_permint | if pc_permint $n <= 14 | - is the PC's PERM intelligence <= 14 |
| pc_permwis | if pc_permwis $n == 14 | - is the PC's PERM wisdom 14 |
| pc_permdex | if pc_permdex $n > 14 | - is the PC's PERM dexterity > 14 |
| pc_permcon | if pc_permcon $n < 14 | - is the PC's PERM constitution < 14 |
| pc_hours | if pc_hours $n >= 10 | - if the PC has 10 or more hours played |
| pc_weight | if pc_weight $n < 250 | - PC Weight Check, standard operators |
| pc_clanlevel | if pc_clanlevel >= 8 | - Is PC's clan level over 8? |
| pc_bcopper | if pc_bcopper $n < 250 | - PC Bank Copper check |
| pc_bgold | if pc_bgold $n > 250 | - PC Bank Gold check |
| pc_bsilver | if pc_bsilver $n < 250 | - PC Bank Silver check |
| pc_bsteel | if pc_bsteel $n > 250 | - PC Bank Steel check |
| pc_bplatinum | if pc_bplatinum $n < 2 | - PC Bank Platinum check |
| pc_subclan | if pc_subclan1 $n subclan1 | - Is PC in subclan1? (see subclan list in helpfile) |
| pc_subclan2 | if pc_subclan2 $n subclan2 | - Is PC in subclan2? (see subclan list in helpfile) |
| pc_ispk | if pc_ispk $n | - Is $n (PC's only) a player killer? |
| rand | if rand 30 | - if random number < 30 |
| Subclans: | ||
| dagreen | if dagreen $n | - Dragonarmy and in Green (main or second) |
| dared | if dared $n | - Dragonarmy and in Red (main or second) |
| dablack | if dablack $n | - Dragonarmy and in Black (main or second) |
| dablue | if dablue $n | - Dragonarmy and in Blue (main or second) |
| dawhite | if dawhite $n | - Dragonarmy and in White (main or second) |
| orlouge | if orlouge $n | - Mariner AND Orlouge (main or subclans) |
| bilson | if bilson $n | - Mariner and in Bilson (main or second) |
| clwhite | if clwhite $n | - Conclave AND White (main or subclans) |
| clblack | if clblack $n | - Conclave AND Black (main or subclans) |
| clred | if clred $n | - Conclave AND Red (main or subclans) |
| hodark | if hodark $n | - Holy Order AND Dark (main or sub) |
| hobal | if hobal $n | - Holy Order AND Balance (main or sub) |
| holight | if holight $n | - Holy Order AND Light (main or sub) |
| rose | if rose $n | - Solamnic Rose |
| crown | if crown $n | - Solamnic Crown |
| sword | if sword $n | - Solamnic Sword |
| isnpc | if isnpc $n | - is $n a mobile |
| ispc | if ispc $n | - is $n a pc |
| isgood | if isgood $n | - is $n good |
| isevil | if isevil $n | - is $n evil |
| isneutral | if isneutral $n | - is $n neutral |
| isimmort | if isimmort $n | - is $n immortal |
| ischarm | if ischarm $n | - is $n charmed |
| isfollow | if isfollow $n | - is $n following, or being escorted |
| mobhere | if mobhere fido if mobhere 1233 | - is there a mob name 'fido' here - is there mob vnum 1233 here |
| objhere | if objhere bottle if objhere 1233 | - is there a object named 'bottle' here - is there obj vnum 1233 here |
| people | if people > 2 | - is there over 2 character in room |
| players | if players > 1 | - does room contain > 1 PCs |
| mobs | if mobs > 2 | - does room contain > 2 mobiles |
| mobexists | if mobexists fido | - is there a fido somewhere |
| objexists | if objexists sword | - is there a sword somewhere |
| clones | if clones > 3 | - are there > 3 mobs of same vnum here |
| order | if order == 0 | - is mob the first in room |
| hour | if hour >= 8 | - is the time after or equal to 8 o'clock |
| isactive | if isactive $n | - is $n's position != SLEEPING |
| pos | if pos $n standing | - is $n standing |
| language | if language $n human | - is $n's language human? |
| isdelay | if isdelay $i | - does $i have mobprog pending |
| isvisible | if isvisible $n | - can mob see $n |
| hastarget | if hastarget $i | - does $i have a valid target |
| istarget | if istarget $n | - is $n mob's target |
| exists | if exists $q | - does $n exist somewhere |
| affected | if affected $n blind | - is $n affected by blind |
| act | if act $i sentinel | - is $i flagged sentinel |
| off | if off $i berserk | - is $i flagged berserk |
| imm | if imm $i fire | - is $i immune to fire |
| carries | if carries $n sword if carries $n 1233 | - does $n have a 'sword' - does $n have obj vnum 1233 |
| wears | if wears $n lantern if wears $n 1233 | - is $n wearing a 'lantern' - is $n wearing obj vnum 1233 |
| has | if has $n weapon | - does $n have obj of type weapon |
| uses | if uses $n armor | - is $n wearing obj of type armor |
| name | if name $n puff | - is $n's name 'puff' |
| clan | if clan $n 'whatever' | - does $n belong to clan 'whatever' |
| race | if race $n dragon | - is $n of 'dragon' race |
| class | if class $n thief | - is $n a thief (mage, cleric, warrior etc) |
| objtype | if objtype $p scroll | - is $p a scroll |
| vnum | if vnum $i == 1233 | - virtual number check |
| hpcnt | if hpcnt $i > 30 | - if hit points are below 30% |
| room | if room $i == 1233 | - room virtual number |
| sex | if sex $i == 0 | - sex check |
| level | if level $n < 5 | - level check |
| align | if align $n < -1000 | - alignment check |
| money | if money $n | - does $n have X money? |
| objval0 | if objval0 > 1000 | - object value[] checks 0..4 |
| objval1 | if objval1 >= 3 | |
| objval2 | if objval2 != 6 | |
| objval3 | if objval3 > 5 | |
| objval4 | if objval4 < 124 | |
| grpsize | if grpsize $n > 6 | - group size check |
| == | is equal to |
| != | is NOT equal to |
| > | is greater than |
| < | is less than |
| >= | is greater than or equal to |
| <= | is less than or equal to |
if objexists trsgp
mob at trsgp mob purge trsgp
endif
if objexists trsgp
mob at trsgp mob purge trsgp
endif
say Thanks, we're just arriving at the docks of Caergoth now!
mob portalto 16200 13610
mob echo A sailor pushes a gangplank off the stern onto the docks at Caergoth.
mob vecho 16200 A sailor ties off the Percheron and pushes a gangplank to the dock.
mob junk ticket
Adding the Mobprog to the MOB
Commands within Medit (while editing a mob, AFTER mprog created)
addmprog [vnum] [trigger] [phrase]
Example: (with a mob being edited)(medit)
addmprog 13456 greet 80 - This adds mprog 13456 to the mobile,
which greets pc's when they enter
80% of the time.
delmprog 0 (or 1,2,3 etc) - removes an mprog from a mob.
NOTE:
[vnum] The vnum of the mob program (mpedit)
[trigger] List of valid triggers and explanations above
[phrase] A single word, or a phrase within quotes
(example: "looks at you" or "yes" etc)
Or a percentile (ie '80' happens 80% of the time)