Manual:Zone Manual/The Room Section/DIL functions for rooms

From DikuMUD Wiki
Jump to navigation Jump to search

DIL functions for rooms

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 manual is for basic zone writing and therefore will not go into how to write your own DIL functions. The VME however is released with many functions for you as an Administrator and your builders to use to make special rooms, NPCs, and objects. The following is a list of all room functions released with the VME 2.0 server.

Death room
This function is a simple function that allows you to create a room to do damage to a player. The death_room can kill them slowly like a fire cave would or it can kill them quickly as if you stuck them in a microwave it is all up to how you set the arguments. It also lets you see the acts the players see so this function can be used on any number of death style rooms. There is no need to understand how the function works just how to use it so with that in mind the following is the functions header.
	//In function.zon
	dilbegin death_room(tick: integer, damage: integer, act_s: string);

As with any function all you have to do is 'dilcopy' the function onto your room with the correct zone name and arguments and it will do the rest. In this DIL you have three arguments to pass The first is the 'tick' or time which in this DIL is broken down into 'ticks' which are 4 ticks per second. Thus if you wanted to get something to do damage every minute you would put '60*4' in that spot. The next is the amount of damage you want done per your time. If for example you want '60' hit +points damage done each round you just put '60' as that argument. Finally is the act shown to the character as a string in quotes. So a finished death room on your room would look like this.

	dilcopy death_room@function(4*60,60,
	"Flames shoot up from the floor burning your butt.");
Force move
This function allows you to move a player or NPC from a room to another room with out having the player or NPC type or do anything.

The following is the definition of the force move DIL

	dilbegin force_move (tick: integer, strings: string, random: integer);

The 'tick' parameter is how fast you want the force move to be triggered. The 'tick' is in 1/4 second increments so to get a one second wait you would place a four. The second parameter is two strings the first being the symbolic name of the room you are forcing the character to. The second string is the act you want shown to the player or NPC when it is moved. The final parameter is either a one or a zero. The one stands for true and it would make the timer trigger randomly fifty percent of the time, while a zero would make it not random.

The following is what the force move would look like if you wanted it to trigger every 30 seconds and give acts of a river.

	dilcopy force_move@function(4*30,{"river2@riverzon","You float down the river."},0);
Safe room
This function creates a safe room where combat is not allowed.

The following is the definition and an example of how to use it.

	//Safe room DIL definition
	dilbegin safe_room ();

	//Example use of Safe room
	dilcopy safe_room@function ();
Previous: Compiling and debugging your first room
Next: A more complex set of rooms