This should successfully start the Blood Pact quest for you:
Function StartQuest: Boolean;
Var
NPC: TNPC;
T1,T2,T3: Integer;
S: TInterfaceChild;
begin
Result := False;
R_FindNPC('Xenia', True, NPC);
if(Not R_TileOnMS(NPC.Tile,100)) then
begin
R_WalkToTile(Point(3246,3198),1,1);
SetAngle(True);
While R_Moving do
Wait(1);
end;
if atTile(NPC.Tile, ['Xenia'], ['Talk'], 100, 15) then
begin
Wait(RandomRange(355,525));
While R_Moving do
Wait(1);
MarkTime(T1);
repeat
if (TimeFromMark(T1) > 5000) then
Exit;
if ClickToContinue then
break;
until (False)
end;
if FindNPCChatText('you need',ClickLeft) then
begin
Wait(RandomRange(355,525));
MarkTime(T2);
repeat
if (TimeFromMark(T2) > 5000) then
Exit;
if ClickToContinue then
MarkTime(T2);
if FindNPCChatText('ll help',ClickLeft) then
break;
until (False)
Wait(RandomRange(1235,1578));
end;
if QScreen_Start then
begin
B := R_GetInterfaceChild(178, 78);
R_ClickInterface(B, 1);
MarkTime(T3);
repeat
if (TimeFromMark(T3) > 5000) then
Exit;
if ClickToContinue then
MarkTime(T3);
if Not InChat then
begin
Stage := 1;
Wait(RandomRange(355,525));
Result := True;
break;
end;
until (False)
end;
end;
And the 'atTile' function:
function atTile(location: TTile; name, action : TStringArray; height, randomness : Integer) : boolean;
var
tilePoint : TPoint;
begin
result := False;
tilePoint := R_tileToMs(location, height);
MMouse(tilePoint.x, tilePoint.y, randomness, randomness);
wait(100);
if(IsUpTextMultiCustom(name) Or IsUpTextMultiCustom(action)) then
begin
ClickMouse2(True);
if DidRedClick then
result := True
else
result := False;
end else if(isUpText('options')) then
begin
clickMouse2(False);
if ChooseOptionMulti(action) then
result := True;
end;
end;
Bear in mind, tiles while doing the quest inside the catacombs are dynamic as Mormonman stated previously. I'd suggest using local tiles or searching directly for objects/NPCs.