//#include "DIALOGS\Oxbay Cutler_Beckett_Dialog.h"
void ProcessDialogEvent()
{
	ref NPChar, PChar, d;
	PChar = GetMainCharacter();
	aref Link, Diag;
	int Itest;

	int iNation;
	string sNation;
	string iDay, iMonth;
	iDay = environment.date.day;
	iMonth = environment.date.month;
	string lastspeak_date = iDay + " " + iMonth;

	string stemp = "";
	DeleteAttribute(&Dialog,"Links");

	makeref(NPChar,CharacterRef);
	makearef(Link, Dialog.Links);
	makeref(d, Dialog);
	makearef(Diag, NPChar.Dialog);

	trace ("----------------------------------" + Dialog.CurrentNode);	
	switch(Dialog.CurrentNode)

	{
		// -----------------------------------Диалог первый - первая встреча
			
		case "First time":
			Dialog.defAni = "dialog_stay1";
			Dialog.defCam = "1";
			Dialog.defSnd = "dialogs\0\017";
			Dialog.defLinkAni = "dialog_1";
			Dialog.defLinkCam = "1";
			Dialog.defLinkSnd = "dialogs\woman\024";
			Dialog.ani = "Dialog_stay2";
			Dialog.cam = "1";
				
			d.Text = DLG_TEXT[0] + GetMyFullName(Pchar) + DLG_TEXT[1];
			link.l1 = DLG_TEXT[2] + GetMyFullName(Pchar) + DLG_TEXT[3];
			link.l1.go = "First Time_talk";
			if (CheckQuestAttribute("Beckett", "start")) AddDialogExitQuest("Beckett_talk_1"); // KK
			if(CheckQuestAttribute("Beckett", "Beckett_first_time_Redmond"))			
			{
				Locations[FindLocation("Redmond_tavern")].reload.l1.disable = 1;
				dialog.text = DLG_TEXT[44] + Pchar.lastname + DLG_TEXT[45];
				link.l1 = DLG_TEXT[46];
				link.l1.go = "delivergold2";
			}
			if(CheckQuestAttribute("Beckett", "seen_the_governor"))
			{
				Locations[FindLocation("Redmond_tavern")].reload.l1.disable = 1;
				dialog.text = DLG_TEXT[91];
				Link.l1 = DLG_TEXT[92];
				Link.l1.go = "Meet_after_joined";
			}
			if(CheckQuestAttribute("Beckett", "ready_for_escort_duty"))
			{
				Locations[FindLocation("Redmond_tavern")].reload.l1.disable = 1;
				dialog.text = DLG_TEXT[91];
				Link.l1 = DLG_TEXT[73];
				Link.l1.go = "Oxbay_troop_Escort_Beckett";
			}
			if(CheckQuestAttribute("Beckett", "Beckett_delivering_gold"))
			{
				Locations[FindLocation("Redmond_tavern")].reload.l1.disable = 1;
				dialog.text = DLG_TEXT[44] + pchar.lastname + DLG_TEXT[45];
				Link.l1 = DLG_TEXT[110];
				Link.l1.go = "deliver_quest_gold";
			}
			if(CheckQuestAttribute("Beckett", "Beckett_delivering_Rheims_journal"))
			{
				dialog.text = DLG_TEXT[44] + pchar.lastname + DLG_TEXT[45];
				Link.l1 = DLG_TEXT[110];
				Link.l1.go = "blaze_return_to_beckett_node";
			}
			if(CheckQuestAttribute("Beckett", "recovered_Becketts_money"))
			{
				dialog.text = DLG_TEXT[104] + pchar.lastname + DLG_TEXT[105];
				Link.l1 = DLG_TEXT[101];
				Link.l1.go = "recoveredmoney2";
			}
			if(CheckQuestAttribute("Beckett", "Beckett_on_the_beach"))
			{
				dialog.text = DLG_TEXT[85] + pchar.lastname + DLG_TEXT[177];
				Link.l1 = DLG_TEXT[178];
				Link.l1.go = "Meeting_in_Greenford_Tavern";
			}
			if(CheckQuestAttribute("Beckett", "Talk_about_Africa_run"))
			{
				dialog.text = DLG_TEXT[44] + pchar.lastname + DLG_TEXT[187];
				Link.l1 = DLG_TEXT[188];
				Link.l1.go = "Talk_about_Africa_run2";
				iTest = iTest + 1;
			}
			if(CheckQuestAttribute("Beckett", "Redmond_not_joined"))
			{
				Locations[FindLocation("Redmond_tavern")].reload.l1.disable = 1;
				dialog.text = DLG_TEXT[85] + pchar.lastname + DLG_TEXT[86];
				Link.l1 = DLG_TEXT[32];
				Link.l1.go = "notgoinglast";
				Link.l2 = DLG_TEXT[33];
				Link.l2.go = "willgolast";
				Link.l3 = DLG_TEXT[34];
				Link.l3.go = "redmondlast";
			}
			if (CheckQuestAttribute("main_line", "blaze_search_danielle_again") || CheckQuestAttribute("main_line", "blaze_search_danielle_again_10"))
			{
				Dialog.snd = "voice\REDI\REDI006";
				dialog.text = DLG_TEXT[22] + Pchar.lastname + DLG_TEXT[217];
				link.l1 = DLG_TEXT[219];
				link.l1.go = "Captured_on_Oxbay5";
				RemoveCharacterEquip(pchar, BLADE_ITEM_TYPE);
				RemoveCharacterEquip(pchar, GUN_ITEM_TYPE);
				EnableEquip(pchar, BLADE_ITEM_TYPE, false);
				EnableEquip(pchar, GUN_ITEM_TYPE, false);
				AddQuestRecord("Where_are_i", 11);
				AddDialogExitQuest("prepare_for_storm");
			}
			if(CheckQuestAttribute("Beckett", "Meet_in_Canyon"))
			{
				dialog.text = DLG_TEXT[85] + pchar.lastname + DLG_TEXT[177];
				link.l1 = DLG_TEXT[178];
				link.l1.go = "Meeting_in_Greenford_Tavern3";
			}	
		break;

		case "First Time_talk":
			d.Text = DLG_TEXT[4] + GetMyFullName(Pchar) + DLG_TEXT[5];
			Link.l1 = DLG_TEXT[6];
			Link.l1.go = "Beckett_talk_2";	
		break;

		case "Beckett_talk_2":
			d.Text = DLG_TEXT[7] + GetMyName(Pchar) + DLG_TEXT[8];
			Link.l1 = DLG_TEXT[9];
			Link.l1.go = "Beckett_talk_3";	
		break;
			
		case "Beckett_talk_3":
			dialog.text = DLG_TEXT[10] + GetMyName(Pchar) + DLG_TEXT[11];
			link.l1 = DLG_TEXT[12];
			link.l1.go = "Beckett_talk_4";
		break;

		case "Beckett_talk_4":
			dialog.text = DLG_TEXT[13];
			link.l1 = DLG_TEXT[14];
			link.l1.go = "Beckett_talk_5";
		break;

		case "Beckett_talk_5":
			dialog.text = DLG_TEXT[15];
			link.l1 = DLG_TEXT[16];
			link.l1.go = "Beckett_talk_6";
		break;

		case "Beckett_talk_6":
			dialog.text = DLG_TEXT[17];
			link.l1 = DLG_TEXT[18];
			link.l1.go = "Beckett_talk_7";
		break;

		case "Beckett_talk_7":
			dialog.text = DLG_TEXT[19] + Pchar.lastname + DLG_TEXT[20];
			link.l1 = DLG_TEXT[21];
			link.l1.go = "Beckett_talk_8";
		break;

		case "Beckett_talk_8":
			dialog.text = DLG_TEXT[22] + Pchar.lastname + DLG_TEXT[23] + " " + DLG_TEXT[24];
			link.l1 = DLG_TEXT[25];
			link.l1.go = "Beckett_talk_9";
		break;

		case "Beckett_talk_9":
			dialog.text = DLG_TEXT[26];
			link.l1 = DLG_TEXT[27];
			link.l1.go = "Beckett_talk_10";
		break;

		case "Beckett_talk_10":
			dialog.text = DLG_TEXT[28];
			link.l1 = DLG_TEXT[29];
			link.l1.go = "Beckett_decide";
		break;

		case "Beckett_decide":
			pchar.quest.Beckett_talk = "nothingyet";
			dialog.text = DLG_TEXT[30] + pchar.lastname + DLG_TEXT[31];
			Link.l1 = DLG_TEXT[33];
			Link.l1.go = "willgo";
			Link.l2 = DLG_TEXT[34];
			Link.l2.go = "Beckett_talk_9";
			Link.l3 = DLG_TEXT[32];
			Link.l3.go = "notgoing";
		break;

		case "notgoing":
			SetQuestHeader("Beckett");
			AddQuestRecord("Beckett",1);
			dialog.text = DLG_TEXT[35];
			link.l1 = DLG_TEXT[42];
			link.l1.go = "originalOxbay_exit";
		break;

		case "willgo":
			SetQuestHeader("Beckett");
			AddQuestRecord("Beckett",2);
			GiveItem2Character(Pchar,"EITC_Passport");
			PlayStereoSound("INTERFACE\took_item.wav");
			if (Pchar.location == "Oxbay_tavern" && (GetNationRelation2MainCharacter(GetTownNation("Oxbay")) != RELATION_ENEMY)) //(!checkquestattribute("Story_OxbayCaptured","1")));
			{	
				dialog.text = DLG_TEXT[36];
				link.l1 = DLG_TEXT[37];
				link.l1.go = "willgo_2";
			}
			if (Pchar.location != "Oxbay_tavern")
			{
				dialog.text = DLG_TEXT[89];
				link.l1 = DLG_TEXT[37];
				link.l1.go = "willgolast2";
				link.l2 = DLG_TEXT[63];
				link.l2.go = "delivergold5";
			}
			if (Pchar.location == "Oxbay_tavern" && CheckQuestAttribute("Story_OxbayCaptured", "1"))
			{
				dialog.text = DLG_TEXT[36];
				link.l1 = DLG_TEXT[37];
				link.l1.go = "willgolast2";
			}
		break;

		case "willgo_2":
			AddQuestRecord("Beckett",3)
			dialog.text = DLG_TEXT[38];
			link.l1 = DLG_TEXT[39];
			link.l1.go = "willgo_3";
		break;

		case "willgo_3":
			ChangeCharacterReputation(pchar, +5);
			AddMoneyToCharacter(pchar, +25000);
			dialog.text = DLG_TEXT[40] + GetMyFullName(Pchar) + DLG_TEXT[41];
			link.l1 = DLG_TEXT[43];
			link.l1.go = "originalOxbay_exit";
		break;

		case "willgolast2":
			ChangeCharacterReputation(pchar, +5);
			AddMoneyToCharacter(pchar, +25000);
			dialog.text = DLG_TEXT[40] + GetMyFullName(Pchar) + DLG_TEXT[41];
			link.l1 = DLG_TEXT[78];
			link.l1.go = "originalOxbay_exit";

		break;

		case "delivergold2":
			dialog.text = DLG_TEXT[47];
			link.l1 = DLG_TEXT[48];
			link.l1.go = "delivergold3";
		break;

		case "delivergold3":
		int tmpgoldnum = GetCargoGoods(pChar, 9);
			dialog.text = DLG_TEXT[49] + Pchar.lastname + DLG_TEXT[50];
		if (tmpgoldnum >= 1)
			{
			link.l1 = DLG_TEXT[61];
			Link.l1.go = "delivergold4";
			}
		if (tmpgoldnum <= 0)
			{
			Link.l2 = DLG_TEXT[51];
			Link.l2.go = "lostgold";
			}
		break;

		case "delivergold4":
		int tmpgldnm = GetCargoGoods(pChar, 9);
		if (tmpgldnm <= 50)
			{
			GiveItem2Character(Pchar,"mineral4");
			AddQuestRecord("Beckett",11);
			AddMoneyToCharacter(pchar, +2000);
			dialog.text = DLG_TEXT[155];
			link.l1 = DLG_TEXT[156];
			link.l1.go = "delivergold5";
			}
		if (tmpgldnm >=51)
			{
			if(AUTO_SKILL_SYSTEM) { AddPartyExpChar(pchar, "Sneak", 1500); }
			else { AddPartyExp(pchar, 1500); }
			AddQuestRecord("Beckett",7);
			AddMoneyToCharacter(pchar, +5000);
			ChangeCharacterReputation(pchar, +5);
			dialog.text = DLG_TEXT[62] + " " + DLG_TEXT[118];
			link.l1 = DLG_TEXT[63];
			link.l1.go = "delivergold5";
			}
		break;

		case "delivergold5":
			SetCharacterGoods(pChar, GOOD_GOLD, 0.0);
			PlayStereoSound("INTERFACE\took_item.wav");
			if (CheckQuestAttribute("Story_1stTaskReceived", "1"))
			{
				dialog.text = DLG_TEXT[64];
				link.l1 = DLG_TEXT[98];
				link.l1.go = "Meet_after_Gov_just_joined";
			} else {
				dialog.text = DLG_TEXT[64];
				link.l1 = DLG_TEXT[68];
				link.l1.go = "staywithmainquest";
				link.l2 = DLG_TEXT[65];
				link.l2.go = "nomainquest";
			}
		break;

		case "lostgold":
			dialog.text = DLG_TEXT[52];
			link.l1 = DLG_TEXT[53];
			link.l1.go = "lostgold2";
		break;

		case "lostgold2":
			dialog.text = DLG_TEXT[54];
			link.l1 = DLG_TEXT[55];
			link.l1.go = "lostgold3";
			link.l2 = DLG_TEXT[103];
			link.l2.go = "lostgold3";
		break;

		case "lostgold3":
			dialog.text = DLG_TEXT[56] + Pchar.lastname + DLG_TEXT[57];
			if (makeint(pchar.money) >= 25000)
			{
				TakeItemFromCharacter(Pchar,"EITC_Passport");
				link.l1 = DLG_TEXT[101];
				link.l1.go = "recoveredmoney2";
				PlayStereoSound("INTERFACE\took_item.wav");
			} else {
				TakeItemFromCharacter(Pchar,"EITC_Passport");
				link.l1 = DLG_TEXT[58];
				link.l1.go = "lostgold4";
				PlayStereoSound("INTERFACE\took_item.wav");
			}
		break;

		case "lostgold4":
			ChangeCharacterReputation(pchar, -5);
			AddQuestRecord("Beckett",8);
			dialog.text = DLG_TEXT[59];
			link.l1 = DLG_TEXT[60];
			link.l1.go = "lostgoldexit";
		break;

		case "lostgold5":
			dialog.text = DLG_TEXT[102];
			link.l1 = DLG_TEXT[107];
			link.l1.go = "lostgoldexitwar";
		break;

		case "recoveredmoney2":
			ChangeCharacterReputation(pchar, -5);
			AddMoneyToCharacter(pchar, -25000);
			AddQuestRecord("Beckett",9)
			dialog.text = DLG_TEXT[106] + Pchar.lastname;
			link.l1 = DLG_TEXT[108];
			link.l1.go = "lostgold5";
			PlayStereoSound("INTERFACE\took_item.wav");
		break;

		case "staywithmainquest":
			dialog.text = DLG_TEXT[69];
			link.l1 = DLG_TEXT[70];
			link.l1.go = "delivergold7";
			link.l2 = DLG_TEXT[84];
			link.l2.go = "endmainquest"; //get out of main quest
		break;

		case "delivergold7":
			dialog.text = DLG_TEXT[71];
			link.l1 = DLG_TEXT[67];
			link.l1.go = "go see governor exit"; // stay with quest
		break;

		case "Meet_after_Gov_just_joined":
			dialog.text = DLG_TEXT[91];
			Link.l1 = DLG_TEXT[92];
			Link.l1.go = "Meet_after_joined";
		
		break;

		case "Meet_after_joined":
			dialog.text = DLG_TEXT[93];
			link.l1 = DLG_TEXT[94];
			link.l1.go = "Meet_after_joined2";
			link.l2 = DLG_TEXT[95];
			link.l2.go = "Meet_after_joined3";	
		break;

		case "Meet_after_joined2":
			dialog.text = DLG_TEXT[96];
			link.l1 = DLG_TEXT[97];
			link.l1.go = "Meet_after_joined3";
		break;

		case "Meet_after_joined3":
			AddQuestRecord("Beckett",6);
			dialog.text = DLG_TEXT[79];
			link.l1 = DLG_TEXT[109];
			link.l1.go = "Meet_after_joined4";
		break;
	
		case "Meet_after_joined4":
			CloseQuestHeader("Beckett");
			SetQuestHeader("Beckett_and_EITC");
			AddQuestRecord("Beckett_and_EITC", 2);
			dialog.text = DLG_TEXT[77];
			link.l1 = DLG_TEXT[78];
			link.l1.go = "Meet_after_Gov4";
		break;

		case "endmainquest":
			pchar.quest.Beckett_talk = "Nomainquest";
			dialog.text = DLG_TEXT[66] + DLG_TEXT[75];
			link.l1 = DLG_TEXT[76];
			link.l1.go = "deliver gold questions2";
		break;

		case "nomainquest":
			pchar.quest.Beckett_talk = "Nomainquest";
			dialog.text = DLG_TEXT[66];
			link.l1 = DLG_TEXT[109];
			link.l1.go = "deliver gold questions2";
		break;

		case "deliver gold questions":
			CloseQuestHeader("Beckett");
			SetQuestHeader("Beckett_and_EITC");
			AddQuestRecord("Beckett_and_EITC", 2);
			dialog.text = DLG_TEXT[77];
			link.l1 = DLG_TEXT[78];
			link.l1.go = "deliverquestexit";
		break;

		case "deliver gold questions2":
			CloseQuestHeader("Beckett");
			SetQuestHeader("Beckett_and_EITC");
			AddQuestRecord("Beckett_and_EITC", 1);
			dialog.text = DLG_TEXT[77];
			link.l1 = DLG_TEXT[78];
			link.l1.go = "deliverquestexit";
		break;

		case "next meet time": // Redmond after Oxbay
			dialog.text = DLG_TEXT[85] + pchar.lastname + DLG_TEXT[86];
			Link.l1 = DLG_TEXT[32];
			Link.l1.go = "notgoinglast";
			Link.l2 = DLG_TEXT[33];
			Link.l2.go = "willgolast";
			Link.l3 = DLG_TEXT[34];
			Link.l3.go = "redmondlast";

		break;

		case "redmondlast":
			dialog.text = DLG_TEXT[26];
			link.l1 = DLG_TEXT[27];
			link.l1.go = "redmondlast2";
		break;

		case "redmondlast2":
			dialog.text = DLG_TEXT[28];
			link.l1 = DLG_TEXT[29];
			link.l1.go = "redmondlast3";
		break;

		case "redmondlast3":
			dialog.text = DLG_TEXT[30] + Pchar.lastname + DLG_TEXT[31];
			link.l1 = DLG_TEXT[32];
			link.l1.go = "notgoinglast2";
			Link.l2 = DLG_TEXT[33];
			Link.l2.go = "willgolast";
		break;

		case "notgoinglast":
			dialog.text = DLG_TEXT[87];
			link.l1 = DLG_TEXT[78];
			link.l1.go = "notgoinglast2";
			link.l2 = DLG_TEXT[34];
			link.l2.go = "redmondlast";
		break;

		case "notgoinglast2":
			AddQuestRecord("Beckett", 10);
			dialog.text = DLG_TEXT[88];
			link.l1 = DLG_TEXT[83];
			link.l1.go = "originalredmondexit";
		break;

		case "willgolast":
			GiveItem2Character(Pchar,"EITC_Passport");
			ChangeCharacterReputation(pchar, +5);
			AddMoneyToCharacter(pchar, +25000);
			dialog.text = DLG_TEXT[89];
			link.l1 = DLG_TEXT[63];
			link.l1.go = "delivergold5";
			PlayStereoSound("INTERFACE\took_item.wav");
		break;

		case "deliver_quest_gold":
		
			Dialog.defAni = "dialog_stay1";
			Dialog.defCam = "1";
			Dialog.defSnd = "dialogs\0\017";
			Dialog.defLinkAni = "dialog_1";
			Dialog.defLinkCam = "1";
			Dialog.defLinkSnd = "dialogs\woman\024";
			Dialog.ani = "Dialog_stay2";
			Dialog.cam = "1";

		int tmpqstgold = GetCargoGoods(pChar, 9);
			dialog.text = DLG_TEXT[111];
		if (tmpqstgold >= 1)
			{
			link.l1 = DLG_TEXT[61] + DLG_TEXT[112];
			Link.l1.go = "deliver_quest_gold2";
			PlayStereoSound("INTERFACE\took_item.wav");
			}
		if (tmpqstgold <= 0)
			{
			Link.l2 = DLG_TEXT[51];
			Link.l2.go = "lostgold";
			}
		break;

		case "deliver_quest_gold2":
		int tmpcalcgldnm = GetCargoGoods(pChar, 9);
		if ((tmpcalcgldnm >= 51) && (tmpcalcgldnm <= 1000))
			{
			if(AUTO_SKILL_SYSTEM) { AddPartyExpChar(pchar, "Sneak", 3000); }
			else { AddPartyExp(pchar, 3000); }
			AddMoneyToCharacter(pchar, +10000);
			dialog.text = DLG_TEXT[62] + " " + DLG_TEXT[113];
			link.l1 = DLG_TEXT[108];
			link.l1.go = "deliver_quest_gold3";
			SetCharacterGoods(pChar, GOOD_GOLD, 0.0);
			PlayStereoSound("INTERFACE\took_item.wav");
			}
		if ((tmpcalcgldnm >= 20) && (tmpcalcgldnm <= 50))		
			{
			if(AUTO_SKILL_SYSTEM) { AddPartyExpChar(pchar, "Sneak", 500); }
			else { AddPartyExp(pchar, 500); }
			AddMoneyToCharacter(pchar, +1500);
			dialog.text = DLG_TEXT[231];
			link.l1 = DLG_TEXT[108];
			link.l1.go = "deliver_quest_gold3";
			SetCharacterGoods(pChar, GOOD_GOLD, 0.0);
			PlayStereoSound("INTERFACE\took_item.wav");
			}
		if ((tmpcalcgldnm >= 1) && (tmpcalcgldnm <= 19))		
			{
			if(AUTO_SKILL_SYSTEM) { AddPartyExpChar(pchar, "Sneak", 50); }
			else { AddPartyExp(pchar, 50); }
			dialog.text = DLG_TEXT[232];
			link.l1 = DLG_TEXT[108];
			link.l1.go = "deliver_quest_gold3";
			GiveItem2Character(Pchar,"mineral4");
			ChangeCharacterReputation(pchar, -5);
			SetCharacterGoods(pChar, GOOD_GOLD, 0.0);
			PlayStereoSound("INTERFACE\took_item.wav");
			}
		break;

		case "deliver_quest_gold3":
			TakeItemFromCharacter(Pchar,"Map_Doc_1");
			PlayStereoSound("INTERFACE\took_item.wav");
			if (checkquestattribute("Beckett_talk", "ship_been_sunk"))
			{
			dialog.text = DLG_TEXT[72];
			link.l1 = DLG_TEXT[73];
			link.l1.go = "Oxbay_troop_Escort_Beckett";
			}
			if (checkquestattribute("Beckett_talk", "Nomainquest"))
			{
			dialog.text = DLG_TEXT[72];
			link.l1 = DLG_TEXT[12];
			link.l1.go = "deliver_quest_gold5noquest";
			}
			if (checkquestattribute("Beckett_talk", "going_for_the_spy"))
			{
			dialog.text = DLG_TEXT[72];
			link.l1 = DLG_TEXT[100];
			link.l1.go = "deliver_quest_gold4";
			}
		break;			

		case "Oxbay_troop_Escort_Beckett":
			AddQuestRecord("Beckett_and_EITC",4);
			dialog.text = DLG_TEXT[74];
			link.l1 = DLG_TEXT[37];
			link.l1.go = "originalredmondexit";
		break;

		case "deliver_quest_gold4":
			dialog.text = DLG_TEXT[71];
			link.l1 = DLG_TEXT[67];
			link.l1.go = "Beckett_troop_escort_exit"; 
		break;

		case "deliver_quest_gold5":
			AddQuestRecord("Beckett_and_EITC",4);
			dialog.text = DLG_TEXT[114];
			link.l1 = DLG_TEXT[67];
			link.l1.go = "Deliver_quest_gold6";
		break;

		case "deliver_quest_gold5noquest":
			pchar.quest.nomainquest = "get_Doc_from_Oxbay";
			AddQuestRecord("Beckett_and_EITC",4);
			dialog.text = DLG_TEXT[114];
			link.l1 = DLG_TEXT[67];
			link.l1.go = "Deliver_quest_gold6";
		break;

		case "deliver_quest_gold6":
			AddMoneyToCharacter(pchar, +6000);
			dialog.text = DLG_TEXT[115];
			link.l1 = DLG_TEXT[78];
			link.l1.go = "originalredmondexit";
			PlayStereoSound("INTERFACE\took_item.wav");
		break;

		case "Meet_after_Gov4":
			dialog.text = DLG_TEXT[88];
			link.l1 = DLG_TEXT[83];
			link.l1.go = "deliverquestexit";
		break;

		case "talk_in_prison_node_1":
			Dialog.defAni = "Dialog_stay1";
			Dialog.ani = "Dialog_stay2";
			Dialog.defCam = "1";
			Dialog.defSnd = "dialogs\0\017";
			Dialog.defLinkAni = "dialog_1";
			Dialog.defLinkCam = "1";
			Dialog.defLinkSnd = "dialogs\woman\024";
			Dialog.cam = "1";
			Dialog.snd = "dialogs\0\009";

			dialog.text = DLG_TEXT[119];
			Link.l1 = DLG_TEXT[150] + PChar.name + " " + PChar.lastname + DLG_TEXT[151] + PChar.ship.name + DLG_TEXT[153] + " " + DLG_TEXT[120];
			Link.l1.go = "The_other_beckett_arrives";
		break;

		case "The_other_beckett_arrives":
			dialog.text = DLG_TEXT[121] + pchar.lastname + DLG_TEXT[122];
			Link.l1 = DLG_TEXT[123];
			Link.l1.go = "The_other_beckett_arrives2";
		break;

		case "The_other_beckett_arrives2":
			dialog.text = DLG_TEXT[124] + pchar.lastname + DLG_TEXT[125];
			Link.l1 = DLG_TEXT[126];
			Link.l1.go = "The_other_beckett_arrives3";
		break;

		case "The_other_beckett_arrives3":
			dialog.text = DLG_TEXT[127];
			Link.l1 = DLG_TEXT[152];
			Link.l1.go = "Inprisonexit";
			CloseQuestHeader("Beckett");
			CloseQuestHeader("Beckett_and_EITC");
			SetQuestHeader("And_now_Beckett_and_Beckett");
			AddQuestRecord("And_now_Beckett_and_Beckett", 1);
			AddDialogExitQuest("exit_from_prison");
			AddQuestRecord("Blaze_in_prison", 6);
			CloseQuestHeader("Blaze_in_prison");
			Diag.TempNode = "first time";
		break;

		case "Escort_to_Residence":
			Dialog.defAni = "dialog_stay1";
			Dialog.defCam = "1";
			Dialog.defSnd = "dialogs\0\017";
			Dialog.defLinkAni = "dialog_1";
			Dialog.defLinkCam = "1";
			Dialog.defLinkSnd = "dialogs\woman\024";
			Dialog.ani = "dialog_stay1";
			Dialog.cam = "1";
			Dialog.snd = "dialogs\0\009";

			RemoveCharacterEquip(pchar, BLADE_ITEM_TYPE);
			RemoveCharacterEquip(pchar, GUN_ITEM_TYPE);
			EnableEquip(pchar, BLADE_ITEM_TYPE, false);
			EnableEquip(pchar, GUN_ITEM_TYPE, false);

			dialog.text = DLG_TEXT[128] + pchar.lastname + DLG_TEXT[129];
			if(!pchar.quest.Beckett_talk == "Nomainquest")
			{
			Link.l1 = DLG_TEXT[130];
			}
			if(pchar.quest.Beckett_talk == "Nomainquest")
			{
			Link.l1 = DLG_TEXT[233];
			}
			Link.l1.go = "Other Beckett & Rheims";
		break;
		
		case "Other Beckett & Rheims":
			if(!pchar.quest.Beckett_talk == "Nomainquest")
			{
			dialog.text = DLG_TEXT[131];
			}
			if(pchar.quest.Beckett_talk == "Nomainquest")
			{
			dialog.text = DLG_TEXT[234];
			}
			Link.l1 = DLG_TEXT[132];
			Link.l1.go = "Other Beckett & Rheims2";
		break;

		case "Other Beckett & Rheims2":
			dialog.text = DLG_TEXT[133];
			link.l1 = DLG_TEXT[134];
			Link.l1.go = "Other Beckett & Rheims3";
		break;

		case "Other Beckett & Rheims3":
			dialog.text = DLG_TEXT[135];
			link.l1 = DLG_TEXT[136];
			link.l1.go = "Other Beckett & Rheims4";
		break;

		case "Other Beckett & Rheims4":
			dialog.text = DLG_TEXT[137];
			link.l1 = DLG_TEXT[138];
			link.l1.go = "Other Beckett & Rheims5";
		break;

		case "Other Beckett & Rheims5":
			dialog.text = DLG_TEXT[139] + pchar.lastname + DLG_TEXT[140];
			link.l1 = DLG_TEXT[141];
			link.l1.go = "Other Beckett & Rheims6";
		break;

		case "Other Beckett & Rheims6":
			dialog.text = DLG_TEXT[142];
			link.l1 = DLG_TEXT[143];
			link.l1.go = "Other Beckett & Rheims7";
		break;

		case "Other Beckett & Rheims7":
			dialog.text = DLG_TEXT[144];
			link.l1 = DLG_TEXT[154];
			link.l1.go = "Other Beckett & Rheims8";
		break;

		case "Other Beckett & Rheims8":
			dialog.text = DLG_TEXT[145];
			link.l1 = DLG_TEXT[146];
			link.l1.go = "Other Beckett & Rheims9";
		break;

		case "Other Beckett & Rheims9":
			dialog.text = DLG_TEXT[147];
			link.l1 = DLG_TEXT[78];
			link.l1.go = "Other Beckett & Rheims10";
		break;

		case "Other Beckett & Rheims10":
			dialog.text = DLG_TEXT[148];
			link.l1 = DLG_TEXT[107];
			link.l1.go = "decisiontimeexit";
			EnableEquip(pchar, BLADE_ITEM_TYPE, true);
			EnableEquip(pchar, GUN_ITEM_TYPE, true);
			EquipCharacterByItem(pchar, FindCharacterItemByGroup(pchar, BLADE_ITEM_TYPE));
			EquipCharacterByItem(pchar, FindCharacterItemByGroup(pchar, GUN_ITEM_TYPE));
			pchar.quest.main_line = "blaze_talk_with_silehard_complete";
			pchar.quest.henry_talk = "henry_new_dialog";
			dialog.CurrentNode = "Beckett_get_moving";
			SetQuestHeader("Blaze_search_Rheims");
			AddQuestRecord("Blaze_search_Rheims", 1);
		break;

		case "Beckett_get_moving":
			Dialog.defAni = "dialog_stay1";
			Dialog.defCam = "1";
			Dialog.defSnd = "dialogs\0\017";
			Dialog.defLinkAni = "dialog_1";
			Dialog.defLinkCam = "1";
			Dialog.defLinkSnd = "dialogs\woman\024";
			Dialog.ani = "dialog_stay1";
			Dialog.cam = "1";
			Dialog.snd = "dialogs\0\009";

			dialog.text = DLG_TEXT[149];
			link.l1 = DLG_TEXT[23];
			link.l1.go = "Silehardtypeexit";
		break;

		case "blaze_return_to_beckett_node":
			Dialog.defAni = "dialog_stay1";
			Dialog.defCam = "1";
			Dialog.defSnd = "dialogs\0\017";
			Dialog.defLinkAni = "dialog_1";
			Dialog.defLinkCam = "1";
			Dialog.defLinkSnd = "dialogs\woman\024";
			Dialog.ani = "dialog_stay1";
			Dialog.cam = "1";
			Dialog.snd = "dialogs\0\009";

			dialog.text = DLG_TEXT[85] + Pchar.lastname + DLG_TEXT[158];
			Link.l1 = DLG_TEXT[159] ;
			TakeItemFromCharacter(Pchar,"RHEIMS_JOURNAL");
			PlayStereoSound("INTERFACE\took_item.wav");
			Link.l1.go = "Beckett_idols_quest";
		break;

		case "Beckett_idols_quest":
			dialog.text = DLG_TEXT[85] + Pchar.lastname + DLG_TEXT[160];
			link.l1 = DLG_TEXT[12];
			link.l1.go = "Beckett_idols_quest2";
		break;

		case "Beckett_idols_quest2":
			dialog.text = DLG_TEXT[161] + characters[GetCharacterIndex(DLG_TEXT[162])].ship.name + DLG_TEXT[163] + characters[GetCharacterIndex(DLG_TEXT[164])].name + " " + characters[GetCharacterIndex(DLG_TEXT[165])].lastname + DLG_TEXT[166] + Pchar.lastname + DLG_TEXT[167];
			link.l1 = DLG_TEXT[78];
			link.l1.go = "Beckett_idols_quest3";
		break;

		case "Beckett_idols_quest3":
			dialog.text = DLG_TEXT[168];
			link.l1 = DLG_TEXT[80];
			link.l1.go = "Beckett_idols_quest4";
		break;

		case "Beckett_idols_quest4":
			dialog.text = DLG_TEXT[81] + DLG_TEXT[169];
			Link.l1 = DLG_TEXT[67];
			Link.l1.go = "Silehardtypeexit";
			CloseQuestHeader("blaze_search_rheims");
			SetQuestHeader("blaze_to_incas_collection");
			AddQuestRecord("blaze_to_incas_collection", 1);
			pchar.quest.main_line = "blaze_to_incas_collection_begin";
			PlayStereoSound("INTERFACE\took_item.wav");
			AddMoneyToCharacter(pchar, 10000);
			setCharacterShipLocation(&characters[GetCharacterIndex("Pirate Captain 05")], "Douwesen_shore_01");
			pchar.quest.prepare_fighting_on_deck.win_condition.l1 = "location";
			pchar.quest.prepare_fighting_on_deck.win_condition.l1.location = "Douwesen_shore_01";
			pchar.quest.prepare_fighting_on_deck.win_condition = "prepare_fighting_on_deck_complete";
			//
			//SetCharacterIslandLocation(&Characters[GetCharacterIndex("Pirate Captain 06")], "DOUWESEN", "quest_ships", "quest_ship_9", "stay", "runaway", "");
			Group_CreateGroup("Pirate Captain 06");
			Group_AddCharacter("Pirate Captain 06", "Pirate Captain 06");
			Group_SetGroupCommander("Pirate Captain 06", "Pirate Captain 06");
			Group_SetAddress("Pirate Captain 06", "Douwesen", "Quest_Ships","Quest_Ship_9");

			pchar.quest.abording_pirate_06.win_condition.l1 = "Character_Capture";
			pchar.quest.abording_pirate_06.win_condition.l1.character = "Pirate Captain 06";
			pchar.quest.abording_pirate_06.win_condition = "abording_pirate_06_complete";
			//
			pchar.quest.kill_pirate_06.win_condition.l1 = "NPC_Death";
			pchar.quest.kill_pirate_06.win_condition.l1.character = "Pirate Captain 06";
			pchar.quest.kill_pirate_06.win_condition = "kill_pirate_06_complete";
			
			Diag.TempNode = "first time";
			characters[GetCharacterIndex("pirate for abordage 01")].location = "ship_deck";
			characters[GetCharacterIndex("pirate for abordage 02")].location = "ship_deck";
			characters[GetCharacterIndex("pirate for abordage 03")].location = "ship_deck";
		break;
		
		case "Idols_for_ship_exchange":
			Dialog.defAni = "dialog_stay1";
			Dialog.defCam = "1";
			Dialog.defSnd = "dialogs\0\017";
			Dialog.defLinkAni = "dialog_1";
			Dialog.defLinkCam = "1";
			Dialog.defLinkSnd = "dialogs\woman\024";
			Dialog.ani = "dialog_stay1";
			Dialog.cam = "1";
			Dialog.snd = "dialogs\0\009";

			dialog.text = DLG_TEXT[22] +pchar.lastname + DLG_TEXT[170];
			link.l1 = DLG_TEXT[61];
			link.l1.go = "Idols_for_ship_exchange3";
			Locations[FindLocation("Redmond_Residence")].reload.l1.disable = 1;
		break;

		case "Idols_for_ship_exchange3":
			dialog.text = DLG_TEXT[171];
			link.l1 = DLG_TEXT[172];
			link.l1.go = "Idols_for_ship_exchange4";
			TakeItemFromCharacter(pchar, INCAS_COLLECTION);
		break;

		case "Idols_for_ship_exchange4":
			dialog.text = DLG_TEXT[173];
			link.l1 = DLG_TEXT[174];
			link.l1.go = "Idols_for_ship_exchange5";
			GiveShip2Character(pchar,"WickedWench","Wicked Wench",ENGLAND,false,false); // PB: Wicked Wench
			AddMoneyToCharacter(pchar, 10000);
			PlayStereoSound("INTERFACE\took_item.wav");
			CloseQuestHeader("blaze_to_incas_collection");
		break;

		case "Idols_for_ship_exchange5":
			dialog.text = DLG_TEXT[175];
			link.l1 = DLG_TEXT[78];
			link.l1.go = "Idols_for_ship_exchange6";
			SetQuestHeader("move_prisoner_from_greenford");
			AddQuestRecord("move_prisoner_from_greenford", 1);
		break;
		
		case "Idols_for_ship_exchange6":
			dialog.text = DLG_TEXT[176];
			link.l1 = DLG_TEXT[107];
			link.l1.go = "exitafterdeliveringidols";
			pchar.quest.henry_talk = "Now_got_Wicked_Wench";
			pchar.quest.main_line = "to_oxbay_by_prisoner";
			Diag.TempNode = "first time";
		break;

		case "Meeting_in_Greenford_Tavern3":
			dialog.text = DLG_TEXT[179];
			link.l1 = DLG_TEXT[180];
			link.l1.go = "Meeting_in_Greenford_Tavern4";
		break;

		case "Meeting_in_Greenford_Tavern4":
			dialog.text = DLG_TEXT[181];
			link.l1 = DLG_TEXT[182];
			link.l1.go = "Meeting_in_Greenford_Tavern5";
		break;

		case "Meeting_in_Greenford_Tavern5":
			dialog.text = DLG_TEXT[183];
			link.l1 = DLG_TEXT[184];
			link.l1.go = "Meeting_in_Greenford_Tavern6";
		break;

		case "Meeting_in_Greenford_Tavern6":
			dialog.text = DLG_TEXT[185];
			link.l1 = DLG_TEXT[186];
			link.l1.go = "canyonexit";
			AddQuestRecord("And_now_Beckett_and_Beckett", 8);
		break;

		case "Talk_about_Africa_run2":
			dialog.text = DLG_TEXT[189];
			link.l1 = DLG_TEXT[190];
			link.l1.go = "Talk_about_Africa_run3";
		break;			

		case "Talk_about_Africa_run3":
			dialog.text = DLG_TEXT[191] + pchar.lastname + DLG_TEXT[192];
			link.l1 = DLG_TEXT[193];
			link.l1.go = "Talk_about_Africa_run4";
		break;

		case "Talk_about_Africa_run4":
			AddMoneyToCharacter(pchar, +50000);
			dialog.text = DLG_TEXT[194];
			link.l1 = DLG_TEXT[195];
			link.l1.go = "Talk_about_Africa_run5";
		break;		

		case "Talk_about_Africa_run5":
			dialog.text = DLG_TEXT[196];
			link.l1 = DLG_TEXT[78];
			link.l1.go = "Talk_about_Africa_run6";
		break;	

		case "Talk_about_Africa_run6":
			dialog.text = DLG_TEXT[197];
			link.l1 = DLG_TEXT[198];
			link.l1.go = "exittosave the slaves";
			AddQuestRecord("move_prisoner_from_greenford", 3);
			CloseQuestHeader("move_prisoner_from_greenford");
			AddQuestRecord("again_find_rheims", 9);
			AddQuestRecord("And_now_Beckett_and_Beckett", 5);
		break;


		case "both_talk_with_Beckett_node":
			Dialog.defAni = "dialog_stay1";
			Dialog.ani = "dialog_stay2";
			Dialog.defCam = "1";
			Dialog.defSnd = "dialogs\0\017";
			Dialog.defLinkAni = "dialog_1";
			Dialog.defLinkCam = "1";
			Dialog.defLinkSnd = "dialogs\woman\024";
			Dialog.cam = "1";
			Dialog.snd = "dialogs\0\009";

			dialog.text = DLG_TEXT[199] + pchar.lastname + DLG_TEXT[200];
			Link.l1 = DLG_TEXT[201];
			Link.l1.go = "both_talk_with_Beckett_2";

			Diag.TempNode = "first time";
		break;

		case "both_talk_with_Beckett_2":
			dialog.text = DLG_TEXT[202] + pchar.lastname + DLG_TEXT[203];
			Link.l1 = DLG_TEXT[204];
			Link.l1.go = "both_talk_with_Beckett_3";
			LAi_ActorAnimation(characterFromID("Cutler Beckett"), "attack_1", "both_talk_with_Beckett_3", 0.0);
			LAi_ActorAnimation(pchar, "hit_2", "both_talk_with_Beckett_3", 0.0);
		break;

		case "both_talk_with_Beckett_3":
			dialog.text = DLG_TEXT[205];
			Link.l1 = DLG_TEXT[206];
			Link.l1.go = "fight_exit";
		break;

		case "fight_exit":
			Diag.CurrentNode = Diag.TempNode;
			DialogExit();
			AddDialogExitQuest("fight_in_residence_complete");
			AddQuestRecord("search_danielle", 3);
		break;

		case "Captured_on_Oxbay2":
			dialog.text = DLG_TEXT[210] + pchar.lastname + DLG_TEXT[211];
			Link.l1 = DLG_TEXT[212];
			Link.l1.go = "Captured_on_Oxbay3";
		break;

		case "Captured_on_Oxbay3":
			dialog.text = DLG_TEXT[213];
			Link.l1 = DLG_TEXT[214];
			Link.l1.go = "Captured_on_Oxbay4";
		break;

		case "Captured_on_Oxbay4":
			dialog.text = DLG_TEXT[215];
			Link.l1 = DLG_TEXT[216];
			Link.l1.go = "exit";
			AddQuestRecord("And_now_Beckett_and_Beckett", 7);
		break;

		case "Captured_on_Oxbay5":
			dialog.text = DLG_TEXT[220] + pchar.lastname + DLG_TEXT[221];
			Link.l1 = DLG_TEXT[222];
			Link.l1.go = "Captured_on_Oxbay6";
		break;

		case "Captured_on_Oxbay6":
			dialog.text = DLG_TEXT[223];
			Link.l1 = DLG_TEXT[224];
			Link.l1.go = "Captured_on_Oxbay7";
		break;

		case "Captured_on_Oxbay7":
			dialog.text = DLG_TEXT[225];
			Link.l1 = DLG_TEXT[226];
			Link.l1.go = "Captured_on_Oxbay9";
		break;

		case "Captured_on_Oxbay9":
			dialog.text = DLG_TEXT[227];
			Link.l1 = DLG_TEXT[228];
			Link.l1.go = "Captured_on_Oxbay10";
		break;

		case "Captured_on_Oxbay10":
			dialog.text = DLG_TEXT[229];
			Link.l1 = DLG_TEXT[230];
			Link.l1.go = "Captured_on_Oxbay2";
		break;

// EXITS: >>
		case "exit":
			Diag.CurrentNode = "First time";		
			DialogExit();
		break;

		case "Silehardtypeexit":
			DialogExit();
			AddDialogExitQuest("Return_with_idols_to_Beckett");
		break;

		case "canyonexit":
			DialogExit();
			AddDialogExitQuest("Beckett_Canyon_walkoff");
		break;

		case "Inprisonexit":
			DialogExit();
			AddDialogExitQuest("Beckett_Goodbye");
		break;

		case "originalredmondexit":
			DialogExit();
			AddDialogExitQuest("Beckett_Goodbye");
		break;

		case "decisiontimeexit":
			DialogExit();
			AddDialogExitQuest("DecisionTime");
		break;

		case "deliverquestexit":
			DialogExit();
			AddDialogExitQuest("More_Gold_ready");
		break;

		case "exitafterdeliveringidols":
			Diag.CurrentNode = "First time";		
			DialogExit();
			AddDialogExitQuest("get_ready_for_Africa");
		break;

		case "exittosave the slaves":
			NPChar.quest.meeting = lastspeak_date;
			Diag.CurrentNode = Diag.TempNode;		
			DialogExit();
			AddDialogExitQuest("Save_the_Slaves");
		break;

		case "go see governor exit":			
			DialogExit();
			AddDialogExitQuest("Going_to_Governor");
		break;

		case "Beckett_troop_escort_exit":
			DialogExit();
			AddDialogExitQuest("going_to_Governor_escort");
		break;

		case "deliver gold exit": 			
			DialogExit();
			AddDialogExitQuest("Beckett_Goodbye");
		break;

		case "lostgoldexitwar":
			Diag.CurrentNode = Diag.TempNode;
			DialogExit();
			AddDialogExitQuest("lost_gold_exit_war");
		break;

		case "lostgoldexit":
			Diag.CurrentNode = Diag.TempNode;
			DialogExit();
			AddDialogExitQuest("lost_gold_exit");
		break;

		case "originalOxbay_exit":
			DialogExit();
			AddDialogExitQuest("Beckett_Leaves_Oxbay");
		break;
	}
}
