Martha, I apologize, I didn't pay close enough attention to what you needed... Yes, of course, it's possible. We'll add extra checks to the first function, i.e.:
function Beacon_Tilgatal_F()
if GetObjectOwner("Dungeon_1") == 1 then
SetObjectPosition("Port_Tilgatal", 81, 133, 0);
sleep(1);
print("Tilgatal Castle is ours");
sleep(1);
else
SetObjectPosition("Port_Tilgatal", 127, 142, 1);
sleep(1);
print("Tilgatal Castle is not ours");
sleep(1);
end;
if GetObjectOwner("Dungeon_2") == 1 then
SetObjectPosition("Port_Halad", 63, 104, 0);
sleep(1);
print("Halad Castle is ours");
sleep(1);
else
SetObjectPosition("Port_Halad", 127, 142, 1);
sleep(1);
print("Halad Castle is not ours");
sleep(1);
end;
if GetObjectOwner("Dungeon_3") == 1 then
SetObjectPosition("Port_Torost", 104, 105, 0);
sleep(1);
print("Torost Castle is ours");
sleep(1);
else
SetObjectPosition("Port_Torost", 127, 142, 1);
sleep(1);
print("Torost Castle is not ours");
sleep(1);
end;
end;
if (GetObjectOwner("Dungeon_1") == 2)
or (GetObjectOwner("Dungeon_1") == 3)
or (GetObjectOwner("Dungeon_1") == 4)
or (GetObjectOwner("Dungeon_1") == 5)
or (GetObjectOwner("Dungeon_1") == 6)
or (GetObjectOwner("Dungeon_1") == 7)
or (GetObjectOwner("Dungeon_1") == 8)
or (GetObjectOwner("Dungeon_1") == 0) then
This check for ownership by players can be shortened to this (since you need only one player to own the Castles):
if (GetObjectOwner("Dungeon_1") ~= 1) then --If the Castle does not belong to the first player, then our authority ends here