#include "nw_i0_2q4luskan"

void main()
{

object oPC = GetPCSpeaker();

object oBurrow1 = GetWaypointByTag("WP_Burrow1");
object oBurrow2 = GetWaypointByTag("WP_Burrow2");
object oBurrow3 = GetWaypointByTag("WP_Burrow3");
object oBurrow4 = GetWaypointByTag("WP_Burrow4");
location lTarget;

int nBADGER = d2();
int nRND = d4();

if (nRND == 1) lTarget = GetLocation(oBurrow1);
if (nRND == 2) lTarget = GetLocation(oBurrow2);
if (nRND == 3) lTarget = GetLocation(oBurrow3);
if (nRND == 4) lTarget = GetLocation(oBurrow4);

if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;

FadeToBlack(oPC, FADE_SPEED_FAST);

AssignCommand(oPC, ClearAllActions());

DelayCommand(2.0, AssignCommand(oPC, ActionJumpToLocation(lTarget)));
DelayCommand(2.5, FadeFromBlack(oPC, FADE_SPEED_SLOW));
if (nBADGER == 1) DelayCommand(3.5, CreateObjectVoid(OBJECT_TYPE_CREATURE, "giantbadger", lTarget));
}


