Manual:DIL Manual/logcrime()
Jump to navigation
Jump to search
logcrime()
Procedure. Reports a crime to the justice system: who did it, to whom, and what.
logcrime(criminal : unitptr, victim : unitptr, crime : integer)
Starts the justice system's witness program (set_witness@justice) on the victim and
on every character around the victim who can see the criminal. Those witnesses then remember the
crime, and guards and the town's justice act on it as justice.zon sets out. The skills in
skills.zon call it when a theft is noticed.
Parameters
| Name | Type | Meaning |
|---|---|---|
| criminal | unitptr | The main suspect. Must be a character. |
| victim | unitptr | Who the crime was done to. Must be a character. |
| crime | integer | The crime, a CRIME_ constant from vme/include/vme.h: CRIME_STEALING (3), CRIME_MURDER (8) or CRIME_PK (64).
|
Notes
- Nothing happens when either one is null or not a character.
- Nothing happens when the victim is an NPC without the
CHAR_PROTECTEDflag:
killing or robbing ordinary monsters is no crime.
CRIME_MURDERandCRIME_PKagainst a victim with the justice
system's CHAR_LEGAL_TARGET flag are ignored.
- Only those who can see the criminal witness it. A thief who failed while hidden or invisible
should be made visible first if the crime is to be seen.
Example
dilbegin caught_stealing(vict : unitptr);
code
{
act("$3n catches you trying to steal!", A_SOMEONE, self, null, vict, TO_CHAR);
act("You catch $1n trying to steal from you!", A_SOMEONE, self, null, vict, TO_VICT);
logcrime(self, vict, CRIME_STEALING);
quit;
}
dilend
A failed theft that the victim notices becomes a crime, as in the steal skill of skills.zon.