builder's lessons » death prog
Death programs
Death programs activate on the death of a mobile. You can set the percentage chance that they have of activating.
>death_prog 100~ if questr(15100, 19, 5, $n) == 6 mpoload 8070 mpmset $n questr 15100 19 5 7 mpechoat $n You have killed one of the secret Lords of Waterdeep! mpechoaround $n $n has killed one of the secret Lords of Waterdeep! endif ~ |
The above program is on an undisclosed mobile in Waterdeep. It happens 100 percent of the time. However what it does will not happen unless the conditions are met. This particular program checks for quest bits in ANOTHER area. It is looking at the area with the vnums that start with 15100. You can check quests in different areas using the questr method. If these bits are correct in that area the prog loads up an object (head of the victim), sets the bits up one step on the PC and then echos at the player and around the player.
>death_prog 100~ if quest(4, 2, $n) == 2 mpoload 28433 mpoload 28434 mpmadd $n exp 500 mpmadd $n lawful -100 mpmadd $n good -100 mpmset $n quest 4 2 3 endif ~ |
The above program is the death prog on mobile who is a citizen of an area. It checks to see if the PC has those quest bits set right before loading up two objects. It gives them 500 experience points before adjusting their lawful and good down.
Most of the time because death progs are associated with quests you will want them to happen 100% of the time. Occasionally there might be an item on a mobile that you want to load only a small chance of the time. So a rare and special object could be loaded this way. Of course there are other uses for such a prog.
>death_prog 1~ mpoload 28431 ~ |
In the above program there is a 1% chance of this object being loaded on the death of this mobile.