Skip to content
Snippets Groups Projects
Commit 7a78c6f4 authored by DarkGod's avatar DarkGod
Browse files

updated lichform quest

parent edfe1b96
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -299,6 +299,10 @@ newBirthDescriptor{
{type="weapon", subtype="staff", name="elm staff", autoreq=true, ego_chance=-1000},
{type="armor", subtype="cloth", name="linen robe", autoreq=true, ego_chance=-1000},
},
resolvers.for_campaign("Maj'Eyal", function()
local p = game:getPlayer(true)
if p:callTalent(p.T_LICH, "canGrantQuest") then p:grantQuest("lichform") end
end)
},
copy_add = {
life_rating = -3,
......
......@@ -24,8 +24,8 @@ desc = function(self, who)
desc[#desc+1] = _t"Your studies have uncovered much surrounding this subject, but now you must prepare for your glorious rebirth."
desc[#desc+1] = _t"You will need:"
if who.level >= 25 then desc[#desc+1] = _t"#LIGHT_GREEN#* You are experienced enough.#WHITE#"
else desc[#desc+1] = _t"#SLATE#* The ceremony will require that you are worthy, experienced, and possessed of a certain amount of power#WHITE#" end
if who.level >= 25 and who.unused_prodigies >= 1 and who:getMag() >= 50 and who:getWil() >= 25 then desc[#desc+1] = _t"#LIGHT_GREEN#* You are experienced enough.#WHITE#"
else desc[#desc+1] = _t"#SLATE#* The ceremony will require that you are worthy, experienced, and possessed of a certain amount of power (level 25, Magic over 50, Willpower over 25 and one prodigy point available).#WHITE#" end
if self:isCompleted("heart") then desc[#desc+1] = _t"#LIGHT_GREEN#* You have 'extracted' the heart of one of your fellow necromancers.#WHITE#"
else desc[#desc+1] = _t"#SLATE#* The beating heart of a powerful necromancer.#WHITE#" end
......@@ -36,7 +36,7 @@ desc = function(self, who)
if who:hasQuest("shertul-fortress").shertul_energy >= 40 then
desc[#desc+1] = _t"#LIGHT_GREEN#* Yiilkgur has enough energy.#WHITE#"
if who:knowTalent(who.T_LICHFORM) then desc[#desc+1] = _t"#LIGHT_GREEN#* You are now on the path of lichdom.#WHITE#"
if who:knowTalent(who.T_LICH) then desc[#desc+1] = _t"#LIGHT_GREEN#* You are now on the path of lichdom.#WHITE#"
else desc[#desc+1] = _t"#SLATE#* Use the control orb of Yiilkgur to begin the ceremony.#WHITE#" end
else desc[#desc+1] = _t"#SLATE#* Your lair must amass enough energy to use in your rebirth (40 energy).#WHITE#" end
else
......@@ -49,20 +49,33 @@ end
on_status_change = function(self, who, status, sub)
if self:isCompleted() then
who:setQuestStatus(self.id, engine.Quest.DONE)
who:learnTalent(who.T_LICHFORM, true, 1, {no_unlearn=true})
require("engine.ui.Dialog"):simplePopup(_t"Lichform", _t"The secrets of death lay open to you! The skill 'Lichform' has been unlocked!")
who.unused_prodigies = who.unused_prodigies - 1
who:learnTalent(who.T_LICH, true, 1, {no_unlearn=true})
require("engine.ui.Dialog"):simplePopup(_t"Lichform", _t"The secrets of death lay open to you! You are to become a Lich upon your next death!")
end
end
check_lichform = function(self, who)
if self:isStatus(self.DONE) then return end
if who.level < 25 then return end
if who:getMag() < 50 then return end
if who:getWil() < 25 then return end
if who.unused_prodigies < 1 then return end
local t = who:getTalentFromId(who.T_LICH)
who.lichform_quest_checker = true
who:learnTalentType("uber/magic", true)
local res, err = who:canLearnTalent(t)
who.lichform_quest_checker = nil
if not res then return end
if not self:isCompleted("heart") then return end
local q = who:hasQuest("shertul-fortress")
if not q then return end
if not q:isCompleted("butler") then return end
if q.shertul_energy < 40 then return end
if not who:knowTalentType("spell/necrosis") then return end
return true
end
......@@ -349,16 +349,22 @@ uberTalent{
return not self:attr("true_undead") and nb > 0
end},
special2={desc=_t"Have completed the ritual", fct=function(self)
if self.lichform_quest_checker then return true end
if not game.state.birth.supports_lich_transform then return true else return self:isQuestStatus(game.state.birth.supports_lich_transform, engine.Quest.DONE) end
end},
stat = {wil=25},
},
is_race_evolution = function(self, t)
if self:attr("necromancy_immune") then return false end
if self:attr("greater_undead") then return false end
if not t:_canGrantQuest(self) then return false end
local nb = 0
for tid, lvl in pairs(self.talents) do local t = self:getTalentFromId(tid) if t.is_necromancy then nb = nb + lvl end end
return not self:attr("true_undead") and nb > 0
return nb > 0
end,
canGrantQuest = function(self, t)
if self:attr("necromancy_immune") then return false end
if self:attr("greater_undead") then return false end
if self:attr("true_undead") then return false end
return true
end,
cant_steal = true,
is_spell = true,
......@@ -399,7 +405,6 @@ uberTalent{
self:attr("undead", 1)
self:attr("true_undead", 1)
self:attr("greater_undead", 1)
self:learnTalentType("undead/lich", true)
......@@ -421,6 +426,7 @@ uberTalent{
game.level.map:particleEmitter(self.x, self.y, 1, "demon_teleport")
end,
on_learn = function(self, t)
self:attr("greater_undead", 1) -- Set that here so that the player cant become an Exarch while waiting for their death to become a Lich
self:learnTalent(self.T_NEVERENDING_UNLIFE, true, 1)
game.bignews:say(120, "#DARK_ORCHID#You are on your way to Lichdom. #{bold}#Your next death will finish the ritual.#{normal}#")
end,
......
......@@ -1392,3 +1392,11 @@ function resolvers.calc.robe_stats(t, e)
e.wielder.resists = e.wielder.resists or {}
e.wielder.resists.all = (e.wielder.resists.all or 0) + 5 + ((e.material_level or 1) * 2)
end
--- Make robes great again
function resolvers.for_campaign(id, fct)
return {__resolver="for_campaign", __resolve_last=true, id, fct}
end
function resolvers.calc.for_campaign(t, e)
if game:isCampaign(t[1]) then t[2](e) end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment