Field: exptol
Type: integer
This field shows the amount of experience the char needs for its next level. Obviously this is a Pc field.
Field: key
Type: string
This field allows you to check or set the key that can open this unit.
Example:
if (obj.key=key_obj.key)
{
sendtext ("Yup you have the key.&",self);
quit;
}
Field: opponentcount
Type: integer
This field gives you the count of PC or NPC that the PC or NPC is fighting.
Example: Dil command to list people you are fighting with
dilbegin ch_combat (arg:string);
var
oppo:unitptr;
i:integer;
code
{
sendtext ("You are fighting the following:&n&n",self);
if (self.opponentcount==0){
sendtext ("NONE!",self);
quit;
}
oppo:=getopponent(self,0);
i:=1;
while (oppo!=null){
sendtext (oppo.name+"&n",self);
oppo:=getopponent(self,i);
i:=i+1;
}
quit;
}
dilend
Field: switched
Type: unitptr
Points at the Character that is switched into this NPC.
Example:\
if (npc.switched.name=="Papi")
{
act ("Papi is my controller!",
A_ALWAYS,npc,null,null,TO_REST);
quit;
}
Field: editing
Type: integer
This field is either 'TRUE' or 'FALSE'. 'TRUE' means the PC is editing and 'False' means it is not. This can be used to make sure you do not bother someone who is editing something with the 'BEGINEDIT' functions.
Example:\
if (pc.editing==TRUE)
{
sendtext ("This character is editing leave him alone.&n",self);
quit;
}
Field: natural_armour
Type: integer
This field is the value of armour that the NPC has when naked. Can be used to create your own damage Dils that act on what an NPC is wearing.
Example:
if (npc.natural_armour==ARM_CHAIN)
{
damage:=50;/*chain damage*/
}
Field: vals
Type: intlist
This field is used to access the integer values on an extra.
Example:\
if (xptr.vals.[0]==5)
{
sendtext ("The buttons says '5'&n",self);
quit;
}