Example Object Mprog – Books w/ Language Skill Requirements

Example Object Mprog – Books w/ Language Skill Requirements

Here’s a simple object prog that will check to see if a player has a high enough language skill level to read a book.

The Item

Vnum: 1001    Type: book       Level: 0          Area[1]: global.are
Cost: 0       Weight: 0.5 lbs Condition: 100    Material: paper
Absolute size: 0      Relative size: 50
Name: test book
Short desc: a test book
Long descr: A test book lies here.
---=======================================================================---
Extended descriptions keywords:
1) book                                                         (  31 bytes)
This is a long and sad story.
---=======================================================================---
Wear Flags:    [take hold]
Extra Flags:   [none]
Extra2 Flags:  [none]
Class Allowances: all classes
[v0] Open = 0     [0]MUDPrograms for object [ 1001]:
Object mudprog triggers: lookat_pre
Number Vnum Trigger Phrase   
------ ---- ------- --------------------
[    0]  1001 lookat_pre 100   

The Mud Prog

Vnum:  1001     Area[1]: global.are
Title: test langugage skill check  Author(s): Phaedra
Last editor: Phaedra on Thu Jan 31 19:57:49 2019 (2 minutes, 59 seconds ago)
Code:
if hasskill $n elven < 50
mob echoat $n You don't know enough Elven to read this book. See help languages.
mob preventobjectaction
endif

The Result at Elven skill level 49:

look book
You don't know enough Elven to read this book. See help languages.

And at Elven 50:

look book
This is a long and sad story.

Leave a Reply