Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LUA] Create Checks for obtaining Semih Lafihna Alter Ego #5631

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions scripts/missions/bastok/2_3_2_The_Emissary_Windurst.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,19 @@ mission.sections =
local missionStatus = player:getMissionStatus(mission.areaId)

if missionStatus == 3 then
local needsSemihTrust = (not player:hasSpell(xi.magic.spell.SEMIH_LAFIHNA) and not player:hasItem(xi.item.CIPHER_OF_SEMIHS_ALTER_EGO)) and 1 or 0
local hasTrustQuest =
(
player:hasKeyItem(xi.ki.SAN_DORIA_TRUST_PERMIT) or
player:hasKeyItem(xi.ki.BASTOK_TRUST_PERMIT) or
player:hasKeyItem(xi.ki.WINDURST_TRUST_PERMIT)
) and 0 or 1

return mission:progressEvent(239, 0, 0, 0, xi.nation.BASTOK, 0, hasTrustQuest, needsSemihTrust)
if xi.settings.main.ENABLE_TRUST_QUESTS == 1 then
local needsSemihTrust = (not player:hasSpell(xi.magic.spell.SEMIH_LAFIHNA) and not player:hasItem(xi.item.CIPHER_OF_SEMIHS_ALTER_EGO)) and 1 or 0
local hasTrustQuest =
(
player:hasKeyItem(xi.ki.SAN_DORIA_TRUST_PERMIT) or
player:hasKeyItem(xi.ki.BASTOK_TRUST_PERMIT) or
player:hasKeyItem(xi.ki.WINDURST_TRUST_PERMIT)
) and 0 or 1

return mission:progressEvent(239, 0, 0, 0, xi.nation.BASTOK, 0, hasTrustQuest, needsSemihTrust)
else
return mission:progressEvent(239)
end
elseif missionStatus == 5 then
return mission:event(240)
elseif missionStatus == 6 then
Expand Down Expand Up @@ -112,6 +116,7 @@ mission.sections =
npcUtil.giveKeyItem(player, xi.ki.SWORD_OFFERING)

if
xi.settings.main.ENABLE_TRUST_QUESTS == 1 and
not player:hasSpell(xi.magic.spell.SEMIH_LAFIHNA) and
not player:hasItem(xi.item.CIPHER_OF_SEMIHS_ALTER_EGO)
then
Expand Down
9 changes: 7 additions & 2 deletions scripts/missions/sandoria/2_3_2_Journey_to_Windurst.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,13 @@ mission.sections =
local missionStatus = player:getMissionStatus(mission.areaId)

if missionStatus == 4 then
local needsSemihTrust = (not player:hasSpell(xi.magic.spell.SEMIH_LAFIHNA) and not player:findItem(xi.item.CIPHER_OF_SEMIHS_ALTER_EGO)) and 1 or 0
if xi.settings.main.ENABLE_TRUST_QUESTS == 1 then
local needsSemihTrust = (not player:hasSpell(xi.magic.spell.SEMIH_LAFIHNA) and not player:findItem(xi.item.CIPHER_OF_SEMIHS_ALTER_EGO)) and 1 or 0

return mission:progressEvent(238, 1, 1, 1, 1, xi.nation.SANDORIA, 0, 0, needsSemihTrust)
return mission:progressEvent(238, 1, 1, 1, 1, xi.nation.SANDORIA, 0, 0, needsSemihTrust)
else
return mission:progressEvent(238)
end
elseif missionStatus == 5 then
return mission:event(240)
elseif missionStatus == 6 then
Expand Down Expand Up @@ -90,6 +94,7 @@ mission.sections =
npcUtil.giveKeyItem(player, xi.ki.SHIELD_OFFERING)

if
xi.settings.main.ENABLE_TRUST_QUESTS == 1 and
not player:hasSpell(xi.magic.spell.SEMIH_LAFIHNA) and
not player:findItem(xi.item.CIPHER_OF_SEMIHS_ALTER_EGO)
then
Expand Down
9 changes: 7 additions & 2 deletions scripts/missions/windurst/2_3_0_The_Three_Kingdoms.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,13 @@ mission.sections =
local missionStatus = player:getMissionStatus(mission.areaId)

if missionStatus == 0 then
local needsSemihTrust = (not player:hasSpell(xi.magic.spell.SEMIH_LAFIHNA) and not player:findItem(xi.item.CIPHER_OF_SEMIHS_ALTER_EGO)) and 1 or 0
if xi.settings.main.ENABLE_TRUST_QUESTS == 1 then
local needsSemihTrust = (not player:hasSpell(xi.magic.spell.SEMIH_LAFIHNA) and not player:findItem(xi.item.CIPHER_OF_SEMIHS_ALTER_EGO)) and 1 or 0

return mission:progressEvent(95, 0, 0, 0, xi.ki.LETTER_TO_THE_CONSULS_WINDURST, 0, 0, 0, needsSemihTrust)
return mission:progressEvent(95, 0, 0, 0, xi.ki.LETTER_TO_THE_CONSULS_WINDURST, 0, 0, 0, needsSemihTrust)
else
return mission:progressEvent(95)
end
elseif missionStatus == 11 then
return mission:progressEvent(101, 0, 0, xi.ki.ADVENTURERS_CERTIFICATE)
else
Expand All @@ -124,6 +128,7 @@ mission.sections =
npcUtil.giveKeyItem(player, xi.ki.LETTER_TO_THE_CONSULS_WINDURST)

if
xi.settings.main.ENABLE_TRUST_QUESTS == 1 and
not player:hasSpell(xi.magic.spell.SEMIH_LAFIHNA) and
not player:findItem(xi.item.CIPHER_OF_SEMIHS_ALTER_EGO)
then
Expand Down
3 changes: 2 additions & 1 deletion scripts/quests/hiddenQuests/Trust_Semih.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ quest.sections =
{
{
check = function(player, questVars, vars)
return not player:hasSpell(xi.magic.spell.SEMIH_LAFIHNA) and
return xi.settings.main.ENABLE_TRUST_QUESTS == 1 and
not player:hasSpell(xi.magic.spell.SEMIH_LAFIHNA) and
not player:findItem(xi.item.CIPHER_OF_SEMIHS_ALTER_EGO) and
player:hasCompletedMission(xi.mission.log_id.ROV, xi.mission.id.rov.THE_PATH_UNTRAVELED)
end,
Expand Down
Loading