ds2.1.1/bin/
ds2.1.1/extra/wolfpaw/
ds2.1.1/lib/cmds/admins/
ds2.1.1/lib/cmds/common/
ds2.1.1/lib/cmds/creators/include/
ds2.1.1/lib/cmds/creators/include/SCCS/
ds2.1.1/lib/daemon/services/
ds2.1.1/lib/doc/
ds2.1.1/lib/doc/efun/all/
ds2.1.1/lib/doc/efun/arrays/
ds2.1.1/lib/doc/efun/buffers/
ds2.1.1/lib/doc/efun/compile/
ds2.1.1/lib/doc/efun/floats/
ds2.1.1/lib/doc/efun/functions/
ds2.1.1/lib/doc/efun/general/
ds2.1.1/lib/doc/efun/mixed/
ds2.1.1/lib/doc/efun/numbers/
ds2.1.1/lib/doc/efun/parsing/
ds2.1.1/lib/doc/faq/
ds2.1.1/lib/doc/hbook/
ds2.1.1/lib/doc/help/classes/
ds2.1.1/lib/doc/lpc/basic/
ds2.1.1/lib/doc/lpc/concepts/
ds2.1.1/lib/doc/lpc/constructs/
ds2.1.1/lib/doc/lpc/etc/
ds2.1.1/lib/doc/lpc/intermediate/
ds2.1.1/lib/doc/lpc/types/
ds2.1.1/lib/doc/misc/
ds2.1.1/lib/doc/old/
ds2.1.1/lib/domains/Ylsrim/
ds2.1.1/lib/domains/Ylsrim/adm/
ds2.1.1/lib/domains/Ylsrim/armor/
ds2.1.1/lib/domains/Ylsrim/broken/
ds2.1.1/lib/domains/Ylsrim/fish/
ds2.1.1/lib/domains/Ylsrim/meal/
ds2.1.1/lib/domains/Ylsrim/npc/
ds2.1.1/lib/domains/Ylsrim/obj/
ds2.1.1/lib/domains/Ylsrim/virtual/
ds2.1.1/lib/domains/Ylsrim/weapon/
ds2.1.1/lib/domains/campus/adm/
ds2.1.1/lib/domains/campus/etc/
ds2.1.1/lib/domains/campus/meals/
ds2.1.1/lib/domains/campus/npc/
ds2.1.1/lib/domains/campus/txt/ai/charles/
ds2.1.1/lib/domains/campus/txt/ai/charles/bak2/
ds2.1.1/lib/domains/campus/txt/ai/charles/bak2/bak1/
ds2.1.1/lib/domains/campus/txt/ai/charly/
ds2.1.1/lib/domains/campus/txt/ai/charly/bak/
ds2.1.1/lib/domains/campus/txt/jenny/
ds2.1.1/lib/domains/default/creator/
ds2.1.1/lib/domains/default/doors/
ds2.1.1/lib/domains/default/etc/
ds2.1.1/lib/domains/default/weap/
ds2.1.1/lib/domains/town/doors/
ds2.1.1/lib/domains/town/txt/
ds2.1.1/lib/domains/town/txt/shame/
ds2.1.1/lib/domains/town/virtual/
ds2.1.1/lib/lib/comp/
ds2.1.1/lib/lib/lvs/
ds2.1.1/lib/lib/user/
ds2.1.1/lib/lib/virtual/
ds2.1.1/lib/log/
ds2.1.1/lib/obj/book_source/
ds2.1.1/lib/obj/include/
ds2.1.1/lib/realms/template/
ds2.1.1/lib/realms/template/area/armor/
ds2.1.1/lib/realms/template/area/npc/
ds2.1.1/lib/realms/template/area/obj/
ds2.1.1/lib/realms/template/area/room/
ds2.1.1/lib/realms/template/area/weap/
ds2.1.1/lib/realms/template/bak/
ds2.1.1/lib/realms/template/cmds/
ds2.1.1/lib/save/kills/o/
ds2.1.1/lib/secure/cfg/
ds2.1.1/lib/secure/cfg/classes/
ds2.1.1/lib/secure/cfg/races/SCCS/
ds2.1.1/lib/secure/cmds/creators/include/
ds2.1.1/lib/secure/cmds/players/
ds2.1.1/lib/secure/cmds/players/include/
ds2.1.1/lib/secure/daemon/include/
ds2.1.1/lib/secure/lib/
ds2.1.1/lib/secure/lib/include/
ds2.1.1/lib/secure/lib/net/
ds2.1.1/lib/secure/lib/net/include/
ds2.1.1/lib/secure/lib/std/
ds2.1.1/lib/secure/modules/
ds2.1.1/lib/secure/npc/
ds2.1.1/lib/secure/obj/include/
ds2.1.1/lib/secure/room/
ds2.1.1/lib/secure/save/
ds2.1.1/lib/secure/save/boards/
ds2.1.1/lib/secure/verbs/creators/
ds2.1.1/lib/shadows/
ds2.1.1/lib/spells/
ds2.1.1/lib/verbs/admins/include/
ds2.1.1/lib/verbs/common/
ds2.1.1/lib/verbs/common/include/
ds2.1.1/lib/verbs/creators/
ds2.1.1/lib/verbs/creators/include/
ds2.1.1/lib/verbs/players/include/SCCS/
ds2.1.1/lib/verbs/rooms/
ds2.1.1/lib/verbs/rooms/include/
ds2.1.1/lib/www/errors/
ds2.1.1/lib/www/images/
ds2.1.1/v22.2b14/
ds2.1.1/v22.2b14/ChangeLog.old/
ds2.1.1/v22.2b14/Win32/
ds2.1.1/v22.2b14/compat/
ds2.1.1/v22.2b14/compat/simuls/
ds2.1.1/v22.2b14/include/
ds2.1.1/v22.2b14/testsuite/
ds2.1.1/v22.2b14/testsuite/clone/
ds2.1.1/v22.2b14/testsuite/command/
ds2.1.1/v22.2b14/testsuite/data/
ds2.1.1/v22.2b14/testsuite/etc/
ds2.1.1/v22.2b14/testsuite/include/
ds2.1.1/v22.2b14/testsuite/inherit/
ds2.1.1/v22.2b14/testsuite/inherit/master/
ds2.1.1/v22.2b14/testsuite/log/
ds2.1.1/v22.2b14/testsuite/single/
ds2.1.1/v22.2b14/testsuite/single/tests/compiler/
ds2.1.1/v22.2b14/testsuite/single/tests/efuns/
ds2.1.1/v22.2b14/testsuite/single/tests/operators/
ds2.1.1/v22.2b14/testsuite/u/
ds2.1.1/v22.2b14/tmp/
ds2.1.1/win32/
#include <lib.h>
#include <dirs.h>
#include <virtual.h>
#define __DIR__ "/domains/town/virtual/"

inherit LIB_VIRT_LAND;

static private int XPosition, YPosition;

varargs void SetLongAndItems(int x, int y, int z);

int LimitTravel(int requested, int maximum){
    if(requested > maximum) return maximum;
    if(requested < 0 ) return 0;
    else return requested;
}

varargs static void create(int x, int y) {
    string n, s, e, w;
    string ne, nw, se, sw;

    int max_north = 25;
    int max_south = 1;
    int max_east = 25;
    int max_west = 1;

    SetNoReplace(1);
    virt_land::create();
    XPosition = x;
    YPosition = y;
    SetClimate("temperate");
    SetAmbientLight(30);
    SetLongAndItems(x, y);
    SetShort("a thick forest");
    if( x == max_east ) e = "forest/" + (x) + "," + y;
    else e = "forest/" + (x+1) + "," + y;
    if( x == max_west ) w = "forest/" + (x) + "," + y;
    else w = "forest/" + (x-1) + "," + y;
    if( y == max_north ) n = "forest/" + x + "," + (y);
    else n = "forest/" + x + "," + (y+1);
    if( y == max_south ) s = "forest/" + x+ "," + (y);
    else s = "forest/" + x + "," + (y-1);

    nw = "forest/" + LimitTravel(x - 1, max_east) + "," + LimitTravel(y+1, max_north);
    ne = "forest/" + LimitTravel(x + 1, max_east) + "," + LimitTravel(y+1, max_north);
    sw = "forest/" + LimitTravel(x - 1, max_east) + "," + LimitTravel(y-1, max_north);
    se = "forest/" + LimitTravel(x + 1, max_east) + "," + LimitTravel(y-1, max_north);

    SetGoMessage("You can't travel in that direction.");
    if( n ) AddExit("north", __DIR__ + n);
    if( s ) AddExit("south", __DIR__ + s);
    if( e ) AddExit("east", __DIR__ + e);
    if( w ) AddExit("west", __DIR__ + w);
    if( ne ) AddExit("northeast", __DIR__ + ne);
    if( nw ) AddExit("northwest", __DIR__ + nw);
    if( se ) AddExit("southeast", __DIR__ + se);
    if( sw ) AddExit("southwest", __DIR__ + sw);

    if(x == 24 && y == 1){
	RemoveExit("south");
	AddExit("south","/domains/town/room/forest_path1");
    }
    else if(y == 1){
	RemoveExit("south");
	RemoveExit("southeast");
	RemoveExit("southwest");
    }
    if(x == 24 && y == 25){
	RemoveExit("north");
	AddExit("north","/domains/town/room/cave_entrance");
    }
    else if(y == 25){
	RemoveExit("north");
	RemoveExit("northeast");
	RemoveExit("northwest");
    }
    if(x == 1){
	RemoveExit("west");
	RemoveExit("northwest");
	RemoveExit("southwest");
    }
    if(x == 25){
	RemoveExit("east");
	RemoveExit("northeast");
	RemoveExit("southeast");
    }


}

varargs void SetLongAndItems(int x, int y, int z) {
    mapping inv, items;
    string str;
    ::SetLongAndItems(x, y, z);

    inv = ([]);
    str = "You are in a vast forest. The trees and "
    "thick vegetation press in from all sides, appearing almost "
    "threatening. "
    "No path marks your way. ";
    if(query_night()) str += "The stars of the night sky "
	"are barely visible through the heavy forest canopy overhead.";
    else str+= "Sunlight penetrates the tree cover with great "
	"difficulty, rendering the forest cool and dark.";
    if(x == 25) str+= " Travel east is made impossible by a river "
	"rushing north to south here. On the other side of the river "
	"a great slope rises, and it appears that on top of it is "
	"a road that leads north to a high plateau.";
    if(y == 25) str+= " A steep cliff rises north of here, making "
	"travel north into the mountains impossible.";
    if(x == 1) str += " The forest is impassably thick to the west.";
    if(y == 1) str += " The forest is impassably thick southward.";
    if(x == 24 && y == 1) str += "\n%^GREEN%^There is a sign here you can read.%^RESET%^";
    if(x == 24 && y == 25) str += "\n%^GREEN%^There is a cave entrance in the cliff wall.%^RESET%^";
    SetItems( ([ "forest" : "It is so vast.",
	({"woods","trees","vegetation","plants"}) : "Thick, foreboding and "
	"oppressive, these seem to add to an air of danger and claustrophobia.", 
	"no path" : "You observe the presence of its absence.",
	({"mountain","mountains"}): "The snow capped peaks of the great "
	"northern range are faintly visible from here.",
	"cliff" : "To the north, a high cliff rises from the forest.",
	({"canopy","forest canopy","heavy forest canopy"}) : "The great "
	"branches and heavy leaves of the trees here form the forest "
	"canopy, almost a ceiling through which little light can pass.",
      ]) );
    if(y == 25) {
	AddItem( ({ "river", "stream", "great river"}), 
	  "This narrow but powerful river presents an insurmountable "
	  "obstacle to further travel east." );
	AddItem( ({ "slope","road","plateau"}), "Looks like that's "
	  "Fort Road, high on a slope and running north to the Fortress "
	  "on the Frontiers.");
    }
    if(x == 24 && y == 25) {
	AddItem(({"cave","opening","entrance","cave entrance"}) , 
	  "This is a rather scary looking opening in the cliff wall, leading "
	  "north into the ground.");
	AddEnter("cave","/domains/town/room/cave_entrance");
    }

    if(x == 24 && y == 1) {
	AddItem("sign" , "This is a hastily-lettered sign planted on the ground.");
	SetRead( ({"sign"}) , "Beware th");
    }
    if( !random(50) ) {
	str += "  Burnt wood, scattered rocks and twigs, and other signs "
	"of an abandoned camp site are scattered about.";
	AddItem( ({ "twigs", "sticks", "kindling", "wood", "burnt wood" }) , 
	  "Though long since burnt to nothing, scattered kindling "
	  "and burnt wood lie about as a memory of travellers who have "
	  "passed through");
	if( random(2) ) {
	    string thing;

	    foreach(thing in ({ "twigs", "sticks", "kindling", "wood" })) 
	    SetSearch(thing, function(object who, string str) {
		  object ob;
		  string thing2;

		  if( !(ob = new("/domains/Ylsrim"+ "/etc/pole")) )
		      return 0;
		  who->eventPrint("You find a fishing pole!");
		  eventPrint((string)who->GetName() + " finds a fishing pole "
		    "among the abandoned campsite.", who);
		  foreach(thing2 in ({ "twigs", "sticks", "kindling", "wood"}))
		  RemoveSearch(thing2);
		  if( !((int)ob->eventMove(this_player())) ) {
		      who->eventPrint("You drop the pole!");
		      eventPrint((string)who->GetName() + " drops the pole.",
			who);
		      ob->eventMove(this_object());
		  }
		  return;
		});
	  }
	}
	else if( !random(10) ) 
	    SetSmell("default", "You smell a distant camp fire.");
	if( !random(25) )
	    inv["/domains/town/npc/forest_orc"] = random(3);
	if( !random(45) )
	    inv["/domains/town/npc/bear"] = 1;
	if( !random(15) )
	    inv["/domains/town/npc/deer"] = 1;
	if( !random(65) )
	    inv["/domains/town/npc/gecko"] = 1;
	if( !random(35) )
	    inv["/domains/town/npc/newt"] = 1;
	if( !random(75) )
	    inv["/domains/town/npc/spider"] = 1;

	else if( !random(14) ) 
	    SetListen("default", "You hear voices in the distance.");
	//if(x == 24 && y == 1) inv["/domains/town/obj/sign"] = 1;
	SetLong(str);
	SetDayLight(25);
	SetNightLight(0);
	SetInventory(inv);
    }