diff --git a/scripts/civilizations/dwarf/quests.lua b/scripts/civilizations/dwarf/quests.lua index 231d2c9282..96928b5722 100644 --- a/scripts/civilizations/dwarf/quests.lua +++ b/scripts/civilizations/dwarf/quests.lua @@ -454,7 +454,7 @@ DefineQuest("andvaris-gold", { PlayerColor = "yellow", Conditions = function(s) if ( - GetFactionExists("oinling-clan") -- Andvari's clan must exist + GetFactionExists("oinling-clan", true) -- Andvari's clan must exist and GetNumUnitsAt(trigger_player, "any", {490 - 256 - NidavellirStartX, 107 - 256 - NidavellirStartY}, {490 + 256 - NidavellirStartX, 107 + 256 - NidavellirStartY}, GetMapLayer("material-plane", "nidavellir", 0)) > 0 -- the player must be within a certain distance of Andvari's holding ) then return true diff --git a/scripts/civilizations/germanic/triggers_the_settlement_of_scandinavia.lua b/scripts/civilizations/germanic/triggers_the_settlement_of_scandinavia.lua index e27c197b9b..b91730962d 100644 --- a/scripts/civilizations/germanic/triggers_the_settlement_of_scandinavia.lua +++ b/scripts/civilizations/germanic/triggers_the_settlement_of_scandinavia.lua @@ -30,7 +30,7 @@ AddTrigger("on-the-vanaquisl-introduction", function() for i=0,(PlayerMax - 2) do - if (GetPlayerData(i, "TotalNumUnitsConstructed") > 0 and GetPlayerData(i, "Faction") == "asa-tribe" and GetFactionExists("vana-tribe")) then + if (GetPlayerData(i, "TotalNumUnitsConstructed") > 0 and GetPlayerData(i, "Faction") == "asa-tribe" and GetFactionExists("vana-tribe", true)) then trigger_player = i return true end @@ -82,7 +82,7 @@ AddTrigger("on-the-vanaquisl-vana-sighted", AddTrigger("westward-migration-introduction", function() for i=0,(PlayerMax - 2) do - if (GetPlayerData(i, "TotalNumUnitsConstructed") > 0 and GetPlayerData(i, "Faction") == "asa-tribe" and GetFactionExists("uralic-tribe")) then + if (GetPlayerData(i, "TotalNumUnitsConstructed") > 0 and GetPlayerData(i, "Faction") == "asa-tribe" and GetFactionExists("uralic-tribe", true)) then trigger_player = i return true end @@ -190,8 +190,8 @@ AddTrigger("the-settlement-of-scandinavia-introduction", if ( GetPlayerData(i, "TotalNumUnitsConstructed") > 0 and GetPlayerData(i, "Faction") == "asa-tribe" - and GetFactionExists("ertebolle-tribe") - and GetFactionExists("gylfing-tribe") + and GetFactionExists("ertebolle-tribe", true) + and GetFactionExists("gylfing-tribe", true) and GetNumUnitsAt(i, "any", {4068 - EarthStartX - 16, 811 - EarthStartY - 16}, {4068 - EarthStartX + 16, 811 - EarthStartY + 16}, GetMapLayer("material-plane", "earth", 0)) > 0 -- must have units near Kiel ) then trigger_player = i @@ -233,7 +233,7 @@ AddTrigger("northwards-to-the-sea-natives-sighted", AddTrigger("northwards-to-the-sea-victory", function() for i=0,(PlayerMax - 2) do - if (GetPlayerData(i, "TotalNumUnitsConstructed") > 0 and GetPlayerData(i, "HasQuest", "the-settlement-of-scandinavia") and GetFactionExists("ertebolle-tribe") == false and GetFactionExists("gylfing-tribe")) then + if (GetPlayerData(i, "TotalNumUnitsConstructed") > 0 and GetPlayerData(i, "HasQuest", "the-settlement-of-scandinavia") and GetFactionExists("ertebolle-tribe", true) == false and GetFactionExists("gylfing-tribe", true)) then trigger_player = i return true end diff --git a/scripts/stratagus.lua b/scripts/stratagus.lua index 15a44e0194..9c999f97a5 100644 --- a/scripts/stratagus.lua +++ b/scripts/stratagus.lua @@ -1175,9 +1175,9 @@ function GetCivilizationExists(civilization) return false end -function GetFactionExists(faction) +function GetFactionExists(faction, only_living) for i=0,(PlayerMax - 2) do - if (Players[i].Type ~= PlayerNobody and (GetPlayerData(i, "Name") == faction or GetPlayerData(i, "Faction") == faction) and GetPlayerData(i, "TotalNumUnitsConstructed") > 0) then + if (Players[i].Type ~= PlayerNobody and (GetPlayerData(i, "Name") == faction or GetPlayerData(i, "Faction") == faction) and (GetPlayerData(i, "TotalNumUnitsConstructed") > 0 or not only_living)) then return true end end