--=========================================================
-- Outcome 1
--=========================================================
Event_FOMPreciousThing.Outcomes[1] = {}
Event_FOMPreciousThing.Outcomes[1].Name = "TXT_KEY_EVENT_FOM_PRECIOUS_THING_OUTCOME_1"
Event_FOMPreciousThing.Outcomes[1].Desc = "TXT_KEY_EVENT_FOM_PRECIOUS_THING_OUTCOME_1_DESC"
Event_FOMPreciousThing.Outcomes[1].CanFunc = (
function(pPlayer)
local iGoldCost = math.ceil(100 * iMod)
Event_FOMPreciousThing.Outcomes[1].Desc = Locale.ConvertTextKey("TXT_KEY_EVENT_FOM_PRECIOUS_THING_OUTCOME_1_DESC", iGoldCost)
if not pPlayer:HasAvailableGreatWorkSlot(GameInfoTypes["GREAT_WORK_SLOT_LITERATURE"]) then return false end
if pPlayer:GetGold() < iGoldCost then return false end
return true
end
)
Event_FOMPreciousThing.Outcomes[1].DoFunc = (
function(pPlayer)
local iGoldCost = math.ceil(100 * iMod)
pPlayer:ChangeGold(-iGoldCost)
pPlayer:InitUnit(GameInfoTypes["UNIT_WRITER"], pPlayer:GetCapitalCity():GetX(), pPlayer:GetCapitalCity():GetY()):PushMission(GameInfoTypes["MISSION_CREATE_GREAT_WORK"])
JFD_SendNotification(pPlayer:GetID(), "NOTIFICATION_GENERIC", Locale.ConvertTextKey("TXT_KEY_EVENT_FOM_PRECIOUS_THING_OUTCOME_1_NOTIFICATION"), Locale.ConvertTextKey("TXT_KEY_EVENT_FOM_PRECIOUS_THING"))
end)