Difference between revisions of "Manual:Zone Manual/The Objects Section/More complex objects"

From DikuMUD Wiki
Jump to navigation Jump to search
(Created page with "=== DIL functions for objects === The DIL language is the language a builder can use to make his own special functions on rooms, NPCs, objects, PCs, and much more. This m...")
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
=== DIL functions for objects ===
+
=== More complex objects ===
  
The DIL language is the language a builder can use to make his own
+
In the last sections you learned all the fields and how to make a
special functions on rooms, NPCs, objects, PCs, and much more. This
+
basic object. In this section we will use the information from the last
manual is for basic zone writing and therefore will not go into how to
+
sections to create some more unique objects for our dragon station zone
write your own DIL functions.  The VME however is released with many
+
There is not a lot of new information here we will be using the DIL functions,
functions for you as an Administrator and your builders to use to make
+
fields, and flags to make objects we have only mentioned before.
special rooms, NPCs, and objects.  The following sections contain a full list of all object
+
==== Making a communication board ====
functions released with the VME 2.0 server.
 
==== Restriction functions ====
 
  
The desire to have different equipment comes from every players
+
In (Link to objdilboard) you learned all there you need to
desire to be different.  The restrict functions were designed to help
+
know about the boards DIL to create a boardIn this small section we
make this a reality by only allowing certain groups of players to wear
+
are going to show you the rest of a board and what a finished one looks
some items.  The restrict functions can be used alone or together to
+
like.
make a greater restricted itemfor example you could make an item,
 
restricted to only females or you could make an item, restricted to females that had a strength greater than 20 and who have
 
done a certain quest.
 
  
All restrict functions have a name that describes what the
+
As with all objects the first step is to fully describe and name
restriction function is for and four other arguments.  the 2nd, 3rd, and
+
your boardWe will stick with the space station theme since our goal
4th argument is the exact same for all restrict functions only the name
+
is to have a complete example zone for you.  The boards symbolic, names, title,
of the restrict and the first argument changes.  The format for the
+
description and extra turned out like this.
restrict functions is as follows.
 
 
  <nowiki>
 
  <nowiki>
dilcopy &lt;function name&gt; (arg 1, &lt;max damage&gt;,
+
info_board
    &lt;percentage&gt;,&lt;Optional DIL&gt;);</nowiki>
 
We will skip the function name and the first argument and get back
 
to them later.
 
  
;max damage and percentage
+
title "a merchant information board"
: The second and third arguments set the damage done when the wrong player wears an object. The reason we are explaining them together is they can work together or separately depending on how you set them.
+
descr "A merchant information Board is mounted on a wall here."
The second argument is the max damage the third argument is the
 
percentage damage.
 
  
When both arguments are set to 0 no damage will be
+
names {"merchant information board","information board","merchant
done when the item is illegally worn.  When the second argument is set
+
board","board"}
to a number like 100 and the third argument is set to 0, exactly 100
 
damage will be done to the player no matter how many hit points he/she
 
has.  So by setting the second argument to a number and setting the
 
third to 0 you could possibly kill your victim since it will remove the
 
amount specified no matter how much the player has.
 
  
If you do not want
+
extra {} "A large flashy black steal board."</nowiki>
to possibly kill your victim the Third argument should be usedIf you
+
Just incase the VME server we have has a spell that can damage
set the second argument to 0 and the third argument to a number it will
+
inanimate objects we will give this board a material type.
do a percent of damage to the player. for example if The third argument
+
  <nowiki>
was set to 25 it would do 25 % damage to a player.
+
MATERIAL_METAL("A very fine quality black steel")</nowiki>
 +
Now for the special stuff for the board.  We need to give the
 +
board a type and copy the board DIL to it.
 +
<nowiki>
 +
type ITEM_BOARD
 +
dilcopy board@boards("info","","rem_res@boards","",100);</nowiki>
 +
There you go nothing to it you have just created your first board.
 +
Now lets bring it all together and tag on an end symbol and we are all
 +
finished.
 +
<nowiki>
 +
info_board
 +
title "a merchant information board"
 +
descr "A merchant information Board is mounted on a wall here."
 +
names {"merchant information board","information board","merchant
 +
board","board"}
  
  You can also use the second and third argument together if you want to set a max amount of
+
extra {}
damage without possibly killing them.  for example if you set the second
+
"A large flashy black steal board."
argument to 100 and third to 25.  The item will do 25% damage up to 100
 
hit points of damage. This all might be a bit confusing so let me show
 
you a few examples and tell you what they would do.
 
  
;second= 0 third = 25
+
MATERIAL_METAL("A very fine quality black steel")
: This would do 25% damage to a player. second =100 third = 0 this would do 100 damage to a player no matter his amount of hit points.
+
type ITEM_BOARD
;second = 25 third = 25
+
dilcopy board@boards("info","","rem_res@boards","",100);
: This would do 25 % damage to a player up to 25 hit points.
 
So if a player had 150 hit points the max that could be removed is 25
 
hit points.
 
  
;optional DIL
+
end</nowiki>
: All restrict DIL functions have a default set of acts.  If you want to make your own set of acts you have to create your own DIL that does nothing more than act.  If you don't understand how this works.  You may want to look in the DIL manual about passing DIL functions as arguments.
+
==== Making a container ====
  
Now we should get back to the first argument and function name
+
I thought it would be cool to have a small weapons locker on the
since they are what control the restricts.  The function name has been
+
space station not to mention event hough we went over the container
chosen so you can easily tell what the restrict was created for
+
macro in (Link to objmacrocontainer), we didn't cover everything
while the first argument changes depending on which restrict you use.
+
you need in fact the macro eaves a few things out because you may or may
The following are what each function restricts name is and what the function
+
not want to set them.
name and first argument are.
 
  
; Guild Restrict
+
As with all objects we start right off by describing the item.
*
+
There is nothing new here so we will just show it to you and go
This function restricts an object to players in a certain
+
on.
guild or guilds. Anyone not in the guild or guilds, will have the damage done as set in the
 
2nd and 3rd arguments unless none is set.  Even if no damage is set the
 
object will be removed off of the players equipment and placed in their
 
inventory.  The following is the definition of the DIL as found in
 
''function.zon''.
 
 
  <nowiki>
 
  <nowiki>
dilbegin guild_restrict
+
wpn_locker
(guilds:stringlist,damage:integer,percent:integer,action:string);</nowiki>
+
 
As the definition indicates the first argument is a stringlist. This
+
title "a weapons locker"
means you can restrict this item to more than one guild.  All guilds in
+
names {"weapons locker","weapon locker","locker"}
the string list will be able to wear this object. If we wanted to make
+
 
an item that only Paladins and sorcerers could wear it would look like
+
descr "a small weapons locker hangs on the wall here."
this.
+
 
 +
extra {}
 +
"It is an ordinary weapons locker that looks like it holds any illegal
 +
weapons that are taken on the station."</nowiki>
 +
Now we need to put in all the information that makes this item a
 +
container that can't be taken but it can be opened and it is
 +
locked.
 
  <nowiki>
 
  <nowiki>
dilcopy guild_restrict@function ({"Midgaard Paladin",
+
manipulate {MANIPULATE_ENTER}
                        "Midgaard Sorcerer"},0,25,"");</nowiki>
+
CONTAINER_DEF(500)
;Anti-guild Restrict
+
open {EX_OPEN_CLOSE, EX_CLOSED,EX_LOCKED}
: This function restricts an object to players not in a certain guild or guilds. Anyone not in the guild or guilds listed, will have the damage done as set in the 2nd and 3rd arguments unless none is setEven if no damage is set the object will be removed off of the players equipment and placed in their inventoryThe following is the definition of the DIL as found in
+
key black_key</nowiki>
''function.zon''.
+
Notice we didn't make the item 'MANIPULATE_TAKE' because
 +
we don't want people to be able to walk off with our weapons locker.
 +
One final touch and we are all finished with the weapons lockerIt is
 +
always nice to put a material type on your items so a spell or a skill
 +
can tell if you can do anything with themSo with our material added
 +
in the full locker would look like this.
 
  <nowiki>
 
  <nowiki>
dilbegin anti_guild_restrict
+
wpn_locker
(guilds:stringlist,damage:integer,percent:integer,action:string);</nowiki>
+
 
As the definition indicates the first argument is a stringlistThis
+
title "a weapons locker"
means you can restrict this item from more than one guildAll guilds in
+
names {"weapons locker","weapon locker","locker"}
the string list will not be able to wear this objectIf we wanted to make
+
descr "a small weapons locker hangs on the wall here."
an item that only Paladins and sorcerers could not wear it would look like
+
 
 +
extra {}
 +
"It is an ordinary weapons locker that looks like it holds any illegal
 +
weapons that are taken on the station."
 +
 
 +
MATERIAL_METAL("A very fine quality steel")
 +
 
 +
manipulate {MANIPULATE_ENTER}
 +
CONTAINER_DEF(500)
 +
open {EX_OPEN_CLOSE, EX_CLOSED,EX_LOCKED}
 +
key black_key
 +
 
 +
end</nowiki>
 +
==== Creating drinks ====
 +
 
 +
In (Link to objmacroliqcont), we covered how to set the size and weight of the container and its content but now we need to talk about some other special things about a drink container verses other objects.
 +
 
 +
The drink container is one of the few objects that has rules on
 +
how you set the title, description and names fieldsThe title and
 +
description fields should ot have anything to do with the liquid inside
 +
the container.  This means if you have a barrel full of water you do not
 +
put the word water in the title or the descriptionIn our case we have
 +
a bag full of wine so we do not put wine in either the title or
 +
descriptionThe reason for this is if the player drinks the bag empty
 +
and then fills it with water and we had put wine in the title or
 +
description it would still be there but the bag would now be full of
 +
water..  Our symbolic, title, and description would then look like
 
this.
 
this.
 
  <nowiki>
 
  <nowiki>
dilcopy anti_guild_restrict@function ({"Midgaard Paladin",
+
liq_ration
                              "Midgaard Sorcerer"},0,25,"");</nowiki>
+
 
;Quest Restrict
+
title "a red bag"
: This function restricts an object to players who have done a certain quest.  Any  player who has not done the quest,
+
descr "A red bag has been gently placed here."</nowiki>
will have the damage done as set in the 2nd and 3rd arguments unless
+
The names on the other hand MUST have the drink name as the last
none is setEven if no damage is set the object will be removed off of
+
name in the name listThe reason it must be the last one is when a
the players equipment and placed in their inventoryThe following is
+
player drinks or pours out the liquid the name is removedIf a player
the definition of the DIL as found in
+
then refills the container the name of the new liquid is added to the
''function.zon''.
+
last name. The bag we are making is full of wine so our names list would
 +
look like this.
 
  <nowiki>
 
  <nowiki>
dilbegin quest_restrict
+
names {"red bag", "bag", "wine"}</nowiki>
(qst:string,damage:integer,percent:integer,action:string);</nowiki>
+
Now we add the liquid define for wine
As the definition indicates the first argument is a string.  The
 
quest restrict is only made to restrict the by one quest at a time.  If
 
you want the item to have multiple quests restrictions you just add
 
another dilcopy to it.  The following Would be an object
 
restricted to one quest.
 
 
  <nowiki>
 
  <nowiki>
dilcopy quest_restrict@function ("Eagles quest complete",0,25,"");</nowiki>
+
LIQ_WINE(1,2,2,0)</nowiki>
;Quests Restrict
+
Finally we add the material type for the bag, the cost to buy the
: This function restricts an object to players who have a certain quest or quests.  Anyone not having all quests in the list of quests, will have the damage done as set in the 2nd and 3rd arguments unless none is set.  Even if no damage is set the object will be removed off of the players equipment and placed in their inventory.  The following is the definition of the DIL as found in
+
container, an extra players can look at, and finally an identify extra so
''function.zon''.
+
if a player casts either the identify or improved identify spell on the
 +
bag they will se itwith all that added The finished drink container
 +
looks like this.
 
  <nowiki>
 
  <nowiki>
dilbegin quests_restrict
+
liq_ration
(qsts:stringlist,damage:integer,percent:integer,action:string);</nowiki>
+
names {"red bag", "bag", "wine"}
As the definition indicates the first argument is a stringlistThis
+
title "a red bag"
means you can restrict this item to more than one quest.  Players that
+
descr "A red bag has been gently placed here."
have not done every quest will not be able to use the object.
+
 
If we wanted to make an item that only players that have finished both
+
extra {}
the 'Eagles quest complete' and the 'Feather fall quest complete' could
+
"A small label reads Tassel Grove's finest.  Year 321"
wear.  It would look like this.
+
 
 +
MATERIAL_ORGANIC("a soft plastic")
 +
manipulate {MANIPULATE_TAKE}
 +
LIQ_WINE(1,2,2,0)
 +
cost 2 IRON_PIECE
 +
 
 +
extra {"$identify"}
 +
"Its the special wine from Tassel grove a small halfling village on the
 +
planet Valhalla.  It seems like a great vintage wine."
 +
 
 +
end</nowiki>
 +
==== Creating food ====
 +
 
 +
The food is very simple to make its just a regular item with the
 +
macros you learned in (Link to objmacrofood)In fact making
 +
food is so simple we almost left it out.  I am only adding this to show
 +
how simple it is to change a regular item like the dragon head we showed
 +
you in (Link to objbasic) into a food item. Now only a sick
 +
person would make a dragon head into food but if you wanted to you just
 +
add the 'FOOD_DEF(...)' and your all set.  here is a basic food that you
 +
might find laying around a space station.
 
  <nowiki>
 
  <nowiki>
dilcopy quests_restrict@function ({"Eagles quest complete",
+
beef_stick
                          "Feather fall quest complete"},0,25,"");</nowiki>
 
;Alignment Restrict
 
: This function restricts an object to players with a certain alignment range.
 
Anyone not in the alignment range,
 
will have the damage done as set in the 3nd and 4th arguments unless
 
none is set.  Even if no damage is set the object will be removed off of
 
the players equipment and placed in their inventory.
 
  
We said at the beginning of this section that all restricts have
+
title "a tough leathery stick"
only 4 arguments. This was a bit of a lie since this restrict has five
+
descr "A tough leathery looking stick is laying here."
argumentsThe reason we didn't count this one is because the first and
+
names {"tough leathery stick","tough leather stick","leathery stick",
second argument in the alignment restrict function are used together and
+
"leather stick","tough stick","stick"}
thus are only really one argument. The following is the definition of the DIL as found in
+
 
''function.zon''.
+
extra {}
 +
"This has the word BEEF burnt into it."
 +
 
 +
manipulate {MANIPULATE_TAKE}
 +
FOOD_DEF(5,0)
 +
weight 1
 +
cost 1 COPPER_PIECE
 +
MATERIAL_ORGANIC("tough beef")
 +
 
 +
end</nowiki>
 +
==== Making a weapon ====
 +
 
 +
Whats a game with out some kind of weapon to chop or bash things
 +
into little piecesWe examined how to set the weapon fields in (Link to objmacroweapon), the object transfers in (Link to objmacrotransfers), and the restriction DIL functions in (Link to objdilrestrict).  Now we will pull all we have learned together
 +
and make a pretty nifty little stiletto.
 +
 
 +
The first part as with all our example objects is to set up the
 +
symbolic, names, title, description, object extra, and material type. this is no
 +
different from any other object so here is what we ended up with
 
  <nowiki>
 
  <nowiki>
dilbegin ali_restrict
+
w_stiletto
(max:integer,min:integer,damage:integer,percent:integer,action:string);</nowiki>
+
title "a stiletto"
As the definition indicates the first and second arguments are two
+
names {"stiletto", "dagger"}
integers.  the first is the max alignment that can wear or use this
+
descr
object and the second is the minimum alignmentSo if we wanted to
+
"A deadly looking stiletto has been left here."
restrict an item to only good players it would look like this.
+
 
 +
extra{}
 +
"This looks like a thieves dream come true. "
 +
 
 +
MATERIAL_METAL("A very fine quality steel")</nowiki>
 +
Now lets add the defines and DIL functions that make this a special weapon
 +
along with the manipulate flags that makes it able to be wieldedWe will give
 +
it a bonus in magic and good craftsmanship along with a plus in
 +
backstab for all those assassins on the game.
 
  <nowiki>
 
  <nowiki>
dilcopy ali_restrict@function (1000,350,0,25,"");</nowiki>
+
manipulate {MANIPULATE_TAKE, MANIPULATE_WIELD}
;Level restrict
+
WEAPON_DEF(WPN_DAGGER, 1, 2)
: This function restricts an object to players above or equal to a certain level.  Any player not at least the level or higher, will have the damage done as set in the 2nd and 3rd arguments unless none is setEven if no damage is set the object will be removed off of the players equipment and placed in their inventory.  This restrict works in the old level system from one to fifty which means if the level restrict is set higher than fifty no player will be able to wear or use this object.  This is good if you have objects that only your administrators should be able to use.  If you want to restrict an object to greater than level fifty for players you need to use the 'vlevel' restrict.  The following is the definition of the DIL as found in ''function.zon''.
+
SKILL_TRANSFER(SKI_BACKSTAB, 2)
 +
dilcopy abi_restrict@function (ABIL_DEX,10,0,25,"");</nowiki>
 +
to finish it off we will give the weapon a cost, rent, and finally
 +
two identifies for the two identify spellsNow that we have it all
 +
defined we pull it together and it looks like this.
 
  <nowiki>
 
  <nowiki>
dilbegin level_restrict
+
w_stiletto
(lvl:integer,damage:integer,percent:integer,action:string);</nowiki>
+
title "a stiletto"
As the definition indicates the first argument is an integer.  The
+
names {"deadly looking stiletto","deadly stiletto","stiletto", "dagger"}
integer for the level restrict can range from 1 to 255.  Thus if we
+
descr
wanted to make an object that only administrator could wear or use it would
+
"A deadly looking stiletto has been left here."
look like this
+
 
<nowiki>
+
extra{}
dilcopy level_restrict@function (51, 0,25,"");</nowiki>
+
"This looks like a thieves dream come true. "
;Virtual Level Restrict
+
 
: This function restricts an object to players above or equal to a certain level.  Any player not at least the level or higher, will have the damage done as set in the 2nd and 3rd arguments unless none is set.  Even if no damage is set the object will be removed off of the players equipment and placed in their inventory.  This restrict works in the new level system from one to infinity.
+
MATERIAL_METAL("A very fine quality steel")
The following is the definition of the DIL as found in ''function.zon''.
+
 
<nowiki>
+
manipulate {MANIPULATE_TAKE, MANIPULATE_WIELD}
dilbegin vlevel_restrict
+
WEAPON_DEF(WPN_DAGGER, 1, 2)
(lvl:integer,damage:integer,percent:integer,action:string);</nowiki>
+
SKILL_TRANSFER(SKI_BACKSTAB, 2)
As the definition indicates the first argument is an integer.  The
+
dilcopy abi_restrict@function (ABIL_DEX,10,0,25,"");
integer for the level restrict can range from 1 to infinite.  Thus if we
+
weight 2
wanted to make an object that only players that have reached the level
+
cost 2 GOLD_PIECE
of 5000 could wear or use, it would look like this.
+
rent 1 COPPER_PIECE
<nowiki>
+
 
dilcopy vlevel_restrict@function (5000, 0,25,"");</nowiki>
+
extra {"$identify"}
;Race restrict
+
"The stiletto looks magical in nature and seems really sharpYou can
: This function restricts an object from players of a certain race. Any player not of the selected race, will have the damage done as set in the 2nd and 3rd arguments unless none is set.  Even if no damage is set the object will be removed off of the players equipment and placed in their inventory.  The following is the definition of the DIL as found in ''function.zon''.
+
tell if you wield it you would be able to backstab someone really easy."
<nowiki>
+
 
dilbegin race_restrict
+
extra{"$improved identify"}
(rc:integer,damage:integer,percent:integer,action:string);</nowiki>
+
"The stiletto gives you a magical bonus of +1 and has a quality of +2.
As the definition indicates the first argument is an integer.  The
+
It also raises your back stabbing skill by 2%You have to have at
integer being passed in should be the race you want to restrict the
+
least 10% in dex before you can wield this magical weapon."
object from.  You can pass in the defines as listed in (Link to app-c) or if you have added races you will find the list of
+
 
races in ''values.h''.  If we wanted to restrict an
+
end</nowiki>
object from humans the following is what it would look like.
+
==== Making armour ====
<nowiki>
+
 
dilcopy race_restrict@function (RACE_HUMAN,0,25,"");</nowiki>
+
In (Link to objmacroarmour) we explained how to set the
;Gender restrict
+
          armour fields now we will finish off by adding some more
: This function restricts an object to players of a certain gender.  Anyone not of the gender, will have the damage done as set in the 2nd and 3rd arguments unless none is set.  Even if no damage is set the object will be removed off of the players equipment and placed in their inventory.  The following is the definition of the DIL as found in
+
          important information about armour in general.
''function.zon''.
 
<nowiki>
 
dilbegin sex_restrict
 
(sx:integer,damage:integer,percent:integer,action:string);</nowiki>
 
As the definition indicates the first argument is an integer.  The
 
integer you should pass in is one of the defines from
 
''vme.h''.  The gender defines are as follows.
 
  <nowiki>
 
#define SEX_NEUTRAL  0
 
#define SEX_MALE      1
 
#define SEX_FEMALE    2</nowiki>
 
If we wanted to make an item that could only be worn by a female
 
player, it would look like this.
 
<nowiki>
 
dilcopy sex_restrict (SEX_FEMALE,0,25,"");</nowiki>
 
;Player restrict
 
: This function restricts an object to players who have a specific name. Any player of the wrong name, will have the damage done as set in the 2nd and 3rd arguments unless none is set.  Even if no damage is set the object will be removed off of the players equipment and placed in their inventory. The following is the definition of the DIL as found in
 
''function.zon''.
 
  <nowiki>
 
dilbegin ply_restrict
 
(pname:string,damage:integer,percent:integer,action:string);</nowiki>
 
As the definition indicates the first argument is a stringThe
 
quest restrict is only made to restrict the quest to one person at a
 
time.  While this DIL was designed to be put on when a player receives a
 
quest item and thus was made to be dilcopied in a DIL you can still put
 
it on when you first create the object if you are making special items
 
for administrators or players that you know in advance. If you want more
 
information about copying a DIL from with in another DIL you will have
 
to read the DIL manual If however you want to restrict this to a single
 
player at compile time of your zone it would look something like
 
this.
 
<nowiki>
 
dilcopy ply_restrict@function ("Whistler",0,25,"");</nowiki>
 
;Ability restrict
 
: This function restricts an object from a player with less than a certain amount of a certain ability. Any player not having the correct amount of a certain ability, will have the damage done as set in the 3nd and 4th arguments unless none is set.  Even if no damage is set the object will be removed off of the players equipment and placed in their inventory.
 
  
We said at the beginning of this section that all restricts have
+
  The most important thing to realize is that not all wear
only 4 argumentsThis was a bit of a lie since this restrict has five
+
          positions on the VME server are armour positionsIn fact
arguments.  The reason we didn't count this one is because the first and
+
          only seven of the wear positions count as armour the rest are
second argument in the ability restrict function are used together and
+
          non-armour positions which we will cover next in (Link to objnon-armour). The following are the armour
thus are only really one argument. The following is the definition of the DIL as found in
+
          positions and their defines.
''function.zon''.
+
{| class="wikitable"
<nowiki>
+
|+Armour positions
dilbegin abi_restrict
+
|-
(abi:integer,min_abi:integer,damage:integer,percent:integer,action:string);</nowiki>
+
!Position
As the definition indicates the first and second arguments are two
+
!Define
integers.  the first is the ability type and the second is the amount of
+
|-
that ability the player needs to have or greater to wear or use the
+
|head
item.  the ability types can be found in ''vme.h'' and
+
|MANIPULATE_WEAR_HEAD
are listed here for convenience.
+
|-
<nowiki>
+
|hands
#define ABIL_MAG              0
+
|MANIPULATE_WEAR_HANDS
#define ABIL_DIV              1
+
|-
#define ABIL_STR              2
+
|arms
#define ABIL_DEX              3
+
|MANIPULATE_WEAR_ARMS
#define ABIL_CON              4
+
|-
#define ABIL_CHA              5
+
|body
#define ABIL_BRA              6
+
|MANIPULATE_WEAR_BODY
#define ABIL_HP                7</nowiki>
+
|-
If you wanted to restrict an object to people having more than 50%
+
|legs
strength it would look like this:
+
|MANIPULATE_WEAR_LEGS
<nowiki>
+
|-
dilcopy abi_restrict@function (ABIL_STR,50,0,25,"");</nowiki>
+
|feet
If you want to restrict an object to more than one ability you
+
|MANIPULATE_WEAR_FEET
only need to add another restrict to the item.  For example if you
+
|-
wanted to restrict it to people having greater than or equal to 50%
+
|cloak
divine and 30% brain.  The item would have these two lines.
+
|MANIPULATE_WEAR_ABOUT
<nowiki>
+
|}
dilcopy abi_restrict@function (ABIL_DIV,50,0,25,"");
+
<blockquote style="background-color: #E8E8E8; font-style: italic; ">There is one more field that works as armour, 'MANIPULATE_WEAR_SHIELD' but since that uses another define it is not shown hereWe will leave that for an exercise for you to do later.</blockquote>
dilcopy abi_restrict@function (ABIL_BRA,30,0,25,"");</nowiki>
 
;Skill restrict
 
: This function restricts an object from a player with less than a certain amount of a certain skill. Any player not having the correct amount of a certain skill, will have the damage done as set in the 3nd and 4th arguments unless none is setEven if no damage is set the object will be removed off of the players equipment and placed in their inventory.
 
  
We said at the beginning of this section that all restricts have
+
First we do the same as we have for every other item, pick the
only 4 arguments.  This was a bit of a lie since this restrict has five
+
symbolic, title, description, extra description, and material type for the plate.
arguments.  The reason we didn't count this one is because the first and
 
second argument in the skill restrict function are used together and
 
thus are only really one argument. The following is the definition of the DIL as found in
 
''function.zon''.
 
<nowiki>
 
dilbegin ski_restrict
 
(ski:integer,min_ski:integer,damage:integer,percent:integer,action:string);</nowiki>
 
As the definition indicates the first and second arguments are two
 
integers.  the first is the skill and the second is the amount of
 
that skill the player needs to have or greater to wear or use the
 
item.  the skills can be found in (Link to app-g) and
 
''values.h''. We have also included the first five skills
 
here for convenience in explaining how the function works.
 
 
  <nowiki>
 
  <nowiki>
#define SKI_TURN_UNDEAD        0
+
pol_plate
#define SKI_SCROLL_USE        1
+
names {"polished breast plate","polished plate","breast plate","plate"}
#define SKI_WAND_USE          2
+
title "a polished breast plate"
#define SKI_CONSIDER          3
+
descr "A polished breast plate has been left here."
#define SKI_DIAGNOSTICS        4</nowiki>
+
MATERIAL_METAL("A high luster silver colored metal")</nowiki>
If you wanted to restrict an object to people having more than 50%
+
Now we pick the armour type in this case I want it to be made like
'turn undead' it would look like this:
+
plate mail and I want it to have a magical bonus and a high
 +
craftsmanship.  Obviously since this is a plate we will pick the body
 +
position.
 
  <nowiki>
 
  <nowiki>
dilcopy ski_restrict@function (ASKI_TURN_UNDEAD,50,0,25,"");</nowiki>
+
manipulate {MANIPULATE_TAKE, MANIPULATE_WEAR_BODY}
If you want to restrict an object to more than one skill you
+
ARMOUR_DEF(ARM_PLATE,5,9)</nowiki>
only need to add another restrict to the itemFor example if you
+
All that is left is to add the cost, rent, the identify extras,
wanted to restrict it to people having greater than or equal to 50%
+
and I felt like putting a 40% strength restriction on the armourWith
in 'turn undead' and 30% in 'scroll use'.  The item would have these two lines.
+
all that added together we finish up with the following piece of
 +
armour.
 
  <nowiki>
 
  <nowiki>
dilcopy ski_restrict@function (SKI_TURN_UNDEAD,50,0,25,"");
+
pol_plate
dilcopy ski_restrict@function (SKI_SCROLL_USE,30,0,25,"");</nowiki>
+
names {"polished breast plate","polished plate","breast plate","plate"}
;Spell restrict
+
title "a polished breast plate"
: This function restricts an object from a player with less than a certain amount of a certain spell. Any player not having the correct amount of a certain spell, will have the damage done as set in the 3nd and 4th arguments unless none is set.  Even if no damage is set the object will be removed off of the players equipment and placed in their inventory.
+
descr "A polished breast plate has been left here."
  
We said at the beginning of this section that all restricts have
+
extra{}
only 4 arguments.  This was a bit of a lie since this restrict has five
+
"This is one shiny plate it seems to be made out of one perfect piece of
arguments.  The reason we didn't count this one is because the first and
+
metalThere doesn't even seem to be any markings of owner ship."
second argument in the spell restrict function are used together and
 
thus are only really one argument. The following is the definition of the DIL as found in
 
''function.zon''.
 
<nowiki>
 
dilbegin sp_restrict
 
(spl:integer,min_sp:integer,damage:integer,percent:integer,action:string);</nowiki>
 
As the definition indicates the first and second arguments are two
 
integers.  the first is the spell and the second is the amount of
 
that spell the player needs to have or greater to wear or use the
 
itemthe spells can be found in (Link to app-h) and
 
''values.h''. We have also included the first five
 
spells here for convenience in explaining how the function works.
 
<nowiki>
 
#define SPL_LOCK              52
 
#define SPL_UNLOCK            53
 
#define SPL_DROWSE            54
 
#define SPL_SLOW              55
 
#define SPL_DUST_DEVIL        56</nowiki>
 
If you wanted to restrict an object to people having more than 50%
 
'lock' spell, it would look like this:
 
<nowiki>
 
dilcopy sp_restrict@function (ASPL_LOCK,50,0,25,"");</nowiki>
 
If you want to restrict an object to more than one spell you
 
only need to add another restrict to the item.  For example if you
 
wanted to restrict it to people having greater than or equal to 50%
 
in 'lock' and 30% in 'unlock' spells.  The item would have these two lines.
 
<nowiki>
 
dilcopy sp_restrict@function (SPL_LOCK,50,0,25,"");
 
dilcopy SPL_restrict@function (SPL_LOCK,30,0,25,"");</nowiki>
 
;Weapon restrict
 
: This function restricts an object from a player with less than a certain amount of a certain weapon. Any player not having the correct amount of a certain weapon, will have the damage done as set in the 3nd and 4th arguments unless none is set.  Even if no damage is set the object will be removed off of the players equipment and placed in their inventory.
 
  
We said at the beginning of this section that all restricts have
+
MATERIAL_METAL("A high luster silver colored metal")
only 4 arguments.  This was a bit of a lie since this restrict has five
 
arguments.  The reason we didn't count this one is because the first and
 
second argument in the weapon restrict function are used together and
 
thus are only really one argument. The following is the definition of the DIL as found in
 
''function.zon''.
 
<nowiki>
 
dilbegin weap_restrict
 
(wpn:integer,min_wpn:integer,damage:integer,percent:integer,action:string);</nowiki>
 
As the definition indicates the first and second arguments are two
 
integers.  the first is the weapon and the second is the amount of
 
that weapon the player needs to have or greater to wear or use the
 
item.  the weapons can be found in (Link to app-d) and
 
''values.h''. We have also included the first five
 
weapons here for convenience in explaining how the function works.
 
<nowiki>
 
#define WPN_BATTLE_AXE    7  /* Two Handed */
 
#define WPN_HAND_AXE      8
 
#define WPN_WAR_MATTOCK  9  /* Two Handed */
 
#define WPN_WAR_HAMMER  10
 
#define WPN_GREAT_SWORD  11  /* Two Handed */</nowiki>
 
If you wanted to restrict an object to people having more than 50%
 
'battle axe', it would look like this:
 
<nowiki>
 
dilcopy weap_restrict@function (WPN_BATTLE_AXE,50,0,25,"");</nowiki>
 
If you want to restrict an object to more than one weapon you
 
only need to add another restrict to the item.  For example if you
 
wanted to restrict it to people having greater than or equal to 50%
 
in 'hand axe' and 30% in 'battle axe' spells.  The item would have these two lines.
 
<nowiki>
 
dilcopy weap_restrict@function (WPN_HAND_AXE,50,0,25,"");
 
dilcopy weap_restrict@function (WPN_BATTLE_AXE,30,0,25,"");</nowiki>
 
==== Tuborg function ====
 
  
What game would be complete with out the Denmark water!  With that
+
manipulate {MANIPULATE_TAKE, MANIPULATE_WEAR_BODY}
in mind the VME 2.0 has a tuborg function that makes a drink give
+
ARMOUR_DEF(ARM_PLATE,5,9)
endurance and health when drank.  The function is defined in
 
''function.zon'' as follows:
 
<nowiki>
 
dilbegin tuborg (s:string);</nowiki>
 
As the definition indicates the tuborg function only has one
 
argument.  The real surprise is that the argument is not used yet in the
 
DIL so no matter what you set it to it doesn't matter.  In the future
 
this argument is going to allow different kinds of tuborgs to be made
 
but for now its just a place holder and all that is needed is a set of
 
double quotes.
 
  
To create a tuborg you just add the following line to your drink
+
dilcopy abi_restrict@function (ABIL_STR,40,0,25,"");
container.
+
cost 2 GOLD_PIECE
<nowiki>
+
rent 3 COPPER_PIECE weight 25
dilcopy tuborg@function ("");</nowiki>
 
==== Message board ====
 
  
Every game needs a way for Administrators and players to exchange
+
extra{"$identify"}
ideas.  The message boards have been designed for this purpose.  The
+
"This is a high quality plate with a magical feeling."
boards function can be easy to use or more difficult depending on what
 
all you want them to do.  The board function is defined in
 
''boards.zon'' as follows.
 
<nowiki>
 
dilbegin board
 
(idxfile:string,l_res:string,r_res:string,p_res:string,bmax:integer);</nowiki>
 
This looks pretty hard I know but to make a normal board we have
 
made it as simple as possible while allowing for the boards to be used
 
in almost any situation. After you make your first board it is pretty
 
much block and copy and change the first argument.  The arguments are as
 
follows:
 
  
;idxfile
+
extra{"$improved identify"}
: The first argument is the board index filename.  It tells the board DIL what name to store the board under so if you create more boards with the same name they will all be pointing to the same messages.  You can put any legal symbolic name in this string and it will work with no problems.
+
"The plate has a magical bonus to your defence of a +5 and a quality of
;l_res
+
+9.  You need 40% in strength to be able to wear it."
: the second argument is a DIL you pass in that does any checks to see if the player looking at the board is allowed to. This requires some knowledge in DIL but we have given some example DIL functions in the
+
end</nowiki>
''boards.zon''.
+
==== Making non-armour worn objects ====
<nowiki>
 
//used to restrict players access to a board
 
dilbegin string admin_res (u:unitptr,v:unitptr);
 
  
//used to restrict non-admin from removing posts
+
In the previous section we defined armour that actually protects
dilbegin string rem_res (u:unitptr, v:unitptr);</nowiki>
+
the char in combat.  Here we will learn how to make the clothing and
So with the 'admin_res' you could do something like
+
jewelery that may not do anything directly to combat but it can give
this:
+
your characters bonuses that help in combat in the long runWe will
<nowiki>
+
start by listing all the non-armour worn positions and their manipulate
dilcopy board@boards ("wizbrd","admin_res@boards"...);</nowiki>
+
defines and then we will give a simple ring object.
Putting the 'admin_res' function in the second argument would make
+
{| class="wikitable"
it so only administrators could look at the boardIf you put an empty
+
|+Non-armour positions
string or two double quotes as the argument it will let anyone look at
+
|-
the board.
+
!Position
;r_res
+
!define
: the third argument is a DIL you pass in that does any checks to see if the player trying to remove a post at the board is allowed to.  This requires some knowledge in DIL but we have given some example DIL functions in the
+
|-
''boards.zon''
+
|ear
<nowiki>
+
|MANIPULATE_WEAR_EAR
//used to restrict players access to a board
+
|-
dilbegin string admin_res (u:unitptr,v:unitptr);
+
|neck
 +
|MANIPULATE_WEAR_NECK
 +
|-
 +
|wrist
 +
|MANIPULATE_WEAR_WRIST
 +
|-
 +
|finger
 +
|MANIPULATE_WEAR_FINGER
 +
|-
 +
|chest
 +
|MANIPULATE_WEAR_CHEST
 +
|-
 +
|back
 +
|MANIPULATE_WEAR_BACK
 +
|-
 +
|waist
 +
|MANIPULATE_WEAR_WAIST
 +
|-
 +
|ankle
 +
|MANIPULATE_WEAR_ANKLE
 +
|}
 +
<blockquote style="background-color: #E8E8E8; font-style: italic; ">When giving ability, skill, weapon, or spell bonuses make sure you realize that positions like ear, neck, wrist, and ankle can all have two on a player.  This means any bonuses you give can be doubled if the player gets two of them</blockquote>
  
//used to restrict non-admin from removing posts
+
I don't want to beat a dead horse so since I have already
dilbegin string rem_res (u:unitptr, v:unitptr);</nowiki>
+
explained armour in (Link to objarmour) the only difference here
So with the 'rem_res' you could do something like
+
is there is no 'ARMOUR_DEF' everything else is the same.  The following
this:
+
was one of the first items my wife made as a new builder and I have
<nowiki>
+
always liked itI know, I am a lush but this way I don't have to write
dilcopy board@boards ("citizen","","rem_res@boards",...);</nowiki>
+
an example.
With the 'rem_res' in the third argument only administrators can
 
now remove from this board but anyone can look at it because of the empty
 
string in the second argumentPutting an empty string in the third
 
argument will make it so anyone can remove from this board.
 
;p_res
 
: the forth argument is a DIL you pass in that does any checks to see if the player trying to post at the board is allowed to.  This requires some knowledge in DIL but we have given some example DIL functions in the
 
''boards.zon''.
 
 
  <nowiki>
 
  <nowiki>
//used to restrict players access to a board
+
  maskwa
dilbegin string admin_res (u:unitptr,v:unitptr);
 
  
//used to restrict non-admin from removing posts
+
names {"maskwa platinum ring", "platinum ring","maskwa ring","maskwa","ring"}
dilbegin string rem_res (u:unitptr, v:unitptr);</nowiki>
+
title "a Maskwa ring"
As you can see we haven't made a post restriction DIL because as of
+
descr "A Maskwa platinum ring is laying here."
yet we haven't found a need for oneIf you have a need for one just
+
MATERIAL_METAL("Platinum, and other precious metals")
look over the two restrict DIL functions we have already mentioned and you will
+
extra {}
find it is really easy to make. We want to allow anyone to post so our
+
"The ring has a large bear headCould this be the legendary head of
dilcopy looks like this:
+
Maskwa?  Any thing formed with its head on it is said to strengthen the
<nowiki>
+
wearer."
dilcopy board@boards ("citizen","","rem_res@boards","",...);</nowiki>
+
type ITEM_WORN
With the 'rem_res' in the third argument only administrators can
+
manipulate {MANIPULATE_TAKE, MANIPULATE_HOLD, MANIPULATE_WEAR_FINGER}
now remove from this board but anyone can post to it because of the empty
+
cost 100 COPPER_PIECE
string in the forth argument.  The empty string again in the second
+
rent 50 IRON_PIECE
argument also allows everyone to look at the board.
+
weight 1
;max
+
STR_TRANSFER(+1)
: The fifth argument is simply the amount of posts that you want to allow to be posted before the board is full.
+
end</nowiki>
 +
<blockquote style="background-color: #E8E8E8; font-style: italic; ">One last thing I forgot to mention.  The item type also changes but then that is not hard to understand since this is not armour it should be some other thing. In the case of non-armour worn items the item type is 'ITEM_WORN'.</blockquote>
  
To make a free for all board where everyone can post, remove
+
<div style='padding-top: 30px; padding-bottom: 20px; text-align: left;float:left;width:50%;'>[[Manual:Zone_Manual/The_Objects_Section/DIL_functions_for_objects|Previous: DIL functions for objects]]</div>
posts, look at what posts are on the board, and have a max of 50 posts it would simply be as
+
<div style='padding-top: 30px; padding-bottom: 20px; text-align: right;float:right;width:50%;'>[[Manual:Zone_Manual/The_Objects_Section/Dragon_station_with_rooms_NPCs_and_objects|Next: Dragon station with rooms, NPCs, and objects]]</div>
follows:
 
<nowiki>
 
dilcopy board@boards("citizen","","","",50);</nowiki>
 
When making a board for players to post concerns to the
 
administrators and only have the administrators be able to remove them,
 
wile still allowing everyone to read them it would look like
 
this.
 
<nowiki>
 
dilcopy board@boards("citizen","","rem_res@boards","",100);</nowiki>
 

Latest revision as of 11:34, 26 May 2020

More complex objects

In the last sections you learned all the fields and how to make a basic object. In this section we will use the information from the last sections to create some more unique objects for our dragon station zone There is not a lot of new information here we will be using the DIL functions, fields, and flags to make objects we have only mentioned before.

Making a communication board

In (Link to objdilboard) you learned all there you need to know about the boards DIL to create a board. In this small section we are going to show you the rest of a board and what a finished one looks like.

As with all objects the first step is to fully describe and name your board. We will stick with the space station theme since our goal is to have a complete example zone for you. The boards symbolic, names, title, description and extra turned out like this.

	info_board

	title "a merchant information board"
	descr "A merchant information Board is mounted on a wall here."

	names {"merchant information board","information board","merchant
	board","board"}

	extra {} "A large flashy black steal board."

Just incase the VME server we have has a spell that can damage inanimate objects we will give this board a material type.

	MATERIAL_METAL("A very fine quality black steel")

Now for the special stuff for the board. We need to give the board a type and copy the board DIL to it.

	type ITEM_BOARD
	dilcopy board@boards("info","","rem_res@boards","",100);

There you go nothing to it you have just created your first board. Now lets bring it all together and tag on an end symbol and we are all finished.

	 info_board
	title "a merchant information board"
	descr "A merchant information Board is mounted on a wall here."
	names {"merchant information board","information board","merchant
	board","board"}

	extra {}
	"A large flashy black steal board."

	MATERIAL_METAL("A very fine quality black steel")
	type ITEM_BOARD
	dilcopy board@boards("info","","rem_res@boards","",100);

	end

Making a container

I thought it would be cool to have a small weapons locker on the space station not to mention event hough we went over the container macro in (Link to objmacrocontainer), we didn't cover everything you need in fact the macro eaves a few things out because you may or may not want to set them.

As with all objects we start right off by describing the item. There is nothing new here so we will just show it to you and go on.

	wpn_locker

	title "a weapons locker"
	names {"weapons locker","weapon locker","locker"}

	descr "a small weapons locker hangs on the wall here."

	extra {}
	"It is an ordinary weapons locker that looks like it holds any illegal
	weapons that are taken on the station."

Now we need to put in all the information that makes this item a container that can't be taken but it can be opened and it is locked.

	manipulate {MANIPULATE_ENTER}
	CONTAINER_DEF(500)
	open {EX_OPEN_CLOSE, EX_CLOSED,EX_LOCKED}
	key black_key

Notice we didn't make the item 'MANIPULATE_TAKE' because we don't want people to be able to walk off with our weapons locker. One final touch and we are all finished with the weapons locker. It is always nice to put a material type on your items so a spell or a skill can tell if you can do anything with them. So with our material added in the full locker would look like this.

	wpn_locker

	title "a weapons locker"
	names {"weapons locker","weapon locker","locker"}
	descr "a small weapons locker hangs on the wall here."

	extra {}
	"It is an ordinary weapons locker that looks like it holds any illegal
	weapons that are taken on the station."

	MATERIAL_METAL("A very fine quality steel")

	manipulate {MANIPULATE_ENTER}
	CONTAINER_DEF(500)
	open {EX_OPEN_CLOSE, EX_CLOSED,EX_LOCKED}
	key black_key

	end

Creating drinks

In (Link to objmacroliqcont), we covered how to set the size and weight of the container and its content but now we need to talk about some other special things about a drink container verses other objects.

The drink container is one of the few objects that has rules on how you set the title, description and names fields. The title and description fields should ot have anything to do with the liquid inside the container. This means if you have a barrel full of water you do not put the word water in the title or the description. In our case we have a bag full of wine so we do not put wine in either the title or description. The reason for this is if the player drinks the bag empty and then fills it with water and we had put wine in the title or description it would still be there but the bag would now be full of water.. Our symbolic, title, and description would then look like this.

	liq_ration

	title "a red bag"
	descr "A red bag has been gently placed here."

The names on the other hand MUST have the drink name as the last name in the name list. The reason it must be the last one is when a player drinks or pours out the liquid the name is removed. If a player then refills the container the name of the new liquid is added to the last name. The bag we are making is full of wine so our names list would look like this.

	names {"red bag", "bag", "wine"}

Now we add the liquid define for wine

	LIQ_WINE(1,2,2,0)

Finally we add the material type for the bag, the cost to buy the container, an extra players can look at, and finally an identify extra so if a player casts either the identify or improved identify spell on the bag they will se it. with all that added The finished drink container looks like this.

	liq_ration
	names {"red bag", "bag", "wine"}
	title "a red bag"
	descr "A red bag has been gently placed here."

	extra {}
	"A small label reads Tassel Grove's finest.  Year 321"

	MATERIAL_ORGANIC("a soft plastic")
	manipulate {MANIPULATE_TAKE}
	LIQ_WINE(1,2,2,0)
	cost 2 IRON_PIECE

	extra {"$identify"}
	"Its the special wine from Tassel grove a small halfling village on the
	planet Valhalla.  It seems like a great vintage wine."

	end

Creating food

The food is very simple to make its just a regular item with the macros you learned in (Link to objmacrofood). In fact making food is so simple we almost left it out. I am only adding this to show how simple it is to change a regular item like the dragon head we showed you in (Link to objbasic) into a food item. Now only a sick person would make a dragon head into food but if you wanted to you just add the 'FOOD_DEF(...)' and your all set. here is a basic food that you might find laying around a space station.

	beef_stick

	title "a tough leathery stick"
	descr "A tough leathery looking stick is laying here."
	names {"tough leathery stick","tough leather stick","leathery stick",
	"leather stick","tough stick","stick"}

	extra {}
	"This has the word BEEF burnt into it."

	manipulate {MANIPULATE_TAKE}
	FOOD_DEF(5,0)
	weight 1
	cost 1 COPPER_PIECE
	MATERIAL_ORGANIC("tough beef")

	end

Making a weapon

Whats a game with out some kind of weapon to chop or bash things into little pieces. We examined how to set the weapon fields in (Link to objmacroweapon), the object transfers in (Link to objmacrotransfers), and the restriction DIL functions in (Link to objdilrestrict). Now we will pull all we have learned together and make a pretty nifty little stiletto.

The first part as with all our example objects is to set up the symbolic, names, title, description, object extra, and material type. this is no different from any other object so here is what we ended up with

	 w_stiletto
	 title "a stiletto"
		 names {"stiletto", "dagger"}
	 descr
	 "A deadly looking stiletto has been left here."

	extra{}
	"This looks like a thieves dream come true. "

	MATERIAL_METAL("A very fine quality steel")

Now lets add the defines and DIL functions that make this a special weapon along with the manipulate flags that makes it able to be wielded. We will give it a bonus in magic and good craftsmanship along with a plus in backstab for all those assassins on the game.

	manipulate {MANIPULATE_TAKE, MANIPULATE_WIELD}
	WEAPON_DEF(WPN_DAGGER, 1, 2)
	SKILL_TRANSFER(SKI_BACKSTAB, 2)
	dilcopy abi_restrict@function (ABIL_DEX,10,0,25,"");

to finish it off we will give the weapon a cost, rent, and finally two identifies for the two identify spells. Now that we have it all defined we pull it together and it looks like this.

	 w_stiletto
	 title "a stiletto"
	 names {"deadly looking stiletto","deadly stiletto","stiletto", "dagger"}
	 descr
	 "A deadly looking stiletto has been left here."

	extra{}
	"This looks like a thieves dream come true. "

	MATERIAL_METAL("A very fine quality steel")

	manipulate {MANIPULATE_TAKE, MANIPULATE_WIELD}
	WEAPON_DEF(WPN_DAGGER, 1, 2)
	SKILL_TRANSFER(SKI_BACKSTAB, 2)
	dilcopy abi_restrict@function (ABIL_DEX,10,0,25,"");
	weight 2
	cost 2 GOLD_PIECE
	rent 1 COPPER_PIECE

	extra {"$identify"}
	"The stiletto looks magical in nature and seems really sharp.  You can
	tell if you wield it you would be able to backstab someone really easy."

	extra{"$improved identify"}
	"The stiletto gives you a magical bonus of +1 and has a quality of +2.
	It also raises your back stabbing skill  by 2%.  You have to have at
	least 10% in dex before you can wield this magical weapon."

	end

Making armour

In (Link to objmacroarmour) we explained how to set the armour fields now we will finish off by adding some more important information about armour in general.

The most important thing to realize is that not all wear positions on the VME server are armour positions. In fact only seven of the wear positions count as armour the rest are non-armour positions which we will cover next in (Link to objnon-armour). The following are the armour positions and their defines.

Armour positions
Position Define
head MANIPULATE_WEAR_HEAD
hands MANIPULATE_WEAR_HANDS
arms MANIPULATE_WEAR_ARMS
body MANIPULATE_WEAR_BODY
legs MANIPULATE_WEAR_LEGS
feet MANIPULATE_WEAR_FEET
cloak MANIPULATE_WEAR_ABOUT

There is one more field that works as armour, 'MANIPULATE_WEAR_SHIELD' but since that uses another define it is not shown here. We will leave that for an exercise for you to do later.

First we do the same as we have for every other item, pick the symbolic, title, description, extra description, and material type for the plate.

	pol_plate
	names {"polished breast plate","polished plate","breast plate","plate"}
	title "a polished breast plate"
	descr "A polished breast plate has been left here."
	MATERIAL_METAL("A high luster silver colored metal")

Now we pick the armour type in this case I want it to be made like plate mail and I want it to have a magical bonus and a high craftsmanship. Obviously since this is a plate we will pick the body position.

	manipulate {MANIPULATE_TAKE, MANIPULATE_WEAR_BODY}
	ARMOUR_DEF(ARM_PLATE,5,9)

All that is left is to add the cost, rent, the identify extras, and I felt like putting a 40% strength restriction on the armour. With all that added together we finish up with the following piece of armour.

	pol_plate
	names {"polished breast plate","polished plate","breast plate","plate"}
	title "a polished breast plate"
	descr "A polished breast plate has been left here."

	extra{}
	"This is one shiny plate it seems to be made out of one perfect piece of
	metal.  There doesn't even seem to be any markings of owner ship."

	MATERIAL_METAL("A high luster silver colored metal")

	manipulate {MANIPULATE_TAKE, MANIPULATE_WEAR_BODY}
	ARMOUR_DEF(ARM_PLATE,5,9)

	dilcopy abi_restrict@function (ABIL_STR,40,0,25,"");
	cost 2 GOLD_PIECE
	rent 3 COPPER_PIECE weight 25

	extra{"$identify"}
	"This is a high quality plate with a magical feeling."

	extra{"$improved identify"}
	"The plate has a magical bonus to your defence of a +5 and a quality of
	+9.  You need 40% in strength to be able to wear it."
	end

Making non-armour worn objects

In the previous section we defined armour that actually protects the char in combat. Here we will learn how to make the clothing and jewelery that may not do anything directly to combat but it can give your characters bonuses that help in combat in the long run. We will start by listing all the non-armour worn positions and their manipulate defines and then we will give a simple ring object.

Non-armour positions
Position define
ear MANIPULATE_WEAR_EAR
neck MANIPULATE_WEAR_NECK
wrist MANIPULATE_WEAR_WRIST
finger MANIPULATE_WEAR_FINGER
chest MANIPULATE_WEAR_CHEST
back MANIPULATE_WEAR_BACK
waist MANIPULATE_WEAR_WAIST
ankle MANIPULATE_WEAR_ANKLE

When giving ability, skill, weapon, or spell bonuses make sure you realize that positions like ear, neck, wrist, and ankle can all have two on a player. This means any bonuses you give can be doubled if the player gets two of them

I don't want to beat a dead horse so since I have already explained armour in (Link to objarmour) the only difference here is there is no 'ARMOUR_DEF' everything else is the same. The following was one of the first items my wife made as a new builder and I have always liked it. I know, I am a lush but this way I don't have to write an example.

	  maskwa

	names {"maskwa platinum ring", "platinum ring","maskwa ring","maskwa","ring"}
	title "a Maskwa ring"
	descr "A Maskwa platinum ring is laying here."
	MATERIAL_METAL("Platinum, and other precious metals")
	extra {}
	"The ring has a large bear head.  Could this be the legendary head of
	Maskwa?  Any thing formed with its head on it is said to strengthen the
	wearer."
	type ITEM_WORN
	manipulate {MANIPULATE_TAKE, MANIPULATE_HOLD, MANIPULATE_WEAR_FINGER}
	cost 100 COPPER_PIECE
	rent 50 IRON_PIECE
	weight 1
	STR_TRANSFER(+1)
	end

One last thing I forgot to mention. The item type also changes but then that is not hard to understand since this is not armour it should be some other thing. In the case of non-armour worn items the item type is 'ITEM_WORN'.

Previous: DIL functions for objects
Next: Dragon station with rooms, NPCs, and objects