Skip to content
Snippets Groups Projects
Commit 151189a5 authored by dg's avatar dg
Browse files

New hooks to add escorts

git-svn-id: http://svn.net-core.org/repos/t-engine4@5616 51575b47-30f0-44d4-a5cc-537603b46e54
parent 97472453
No related branches found
No related tags found
No related merge requests found
......@@ -2482,6 +2482,7 @@ function _M:levelup()
if self.unused_talents > 0 then points[#points+1] = ("%d class talent point(s)"):format(self.unused_talents) end
if self.unused_generics > 0 then points[#points+1] = ("%d generic talent point(s)"):format(self.unused_generics) end
if self.unused_talents_types > 0 then points[#points+1] = ("%d category point(s)"):format(self.unused_talents_types) end
if self.unused_prodigies > 0 then points[#points+1] = ("#VIOLET#%d prodigies point(s)"):format(self.unused_prodigies) end
if #points > 0 then game.log("%s has %s to spend. %s", self.name:capitalize(), table.concat(points, ", "), more) end
if self.level == 10 then world:gainAchievement("LEVEL_10", self) end
......
......@@ -165,7 +165,7 @@ local reward_types = {
["chronomancy/chronomancy"] = 0.7,
},
talents = {
[Talents.T_PRECOGNIION] = 1,
[Talents.T_PRECOGNITION] = 1,
[Talents.T_SPIN_FATE] = 1,
},
stats = {
......@@ -204,6 +204,10 @@ local reward_types = {
},
},
}
local hd = {"Quest:escort:reward", reward_types=reward_types}
if require("engine.class"):triggerHook(hd) then reward_types = hd.reward_types end
local reward = reward_types[npc.reward_type]
local quest = game.player:hasQuest(npc.quest_id)
if quest.to_zigur and reward.antimagic then reward = reward.antimagic reward.is_antimagic = true end
......@@ -260,7 +264,7 @@ local function generate_rewards()
local doit = function(npc, player) game.party:reward("Select the party member to receive the reward:", function(player)
if game.player:knowTalentType(t.type[1]) == nil then player:setTalentTypeMastery(t.type[1], 0.7) end
player:learnTalent(tid, true, level, {no_unlearn=true})
if t.hide then player.__show_special_talents[tid] = true end
--if t.hide then player.__show_special_talents[tid] = true end
player:hasQuest(npc.quest_id).reward_message = ("%s talent %s (+%d level(s))"):format(game.player:knowTalent(tid) and "improved" or "learnt", t.name, level)
end) end
answers[#answers+1] = {
......
......@@ -261,7 +261,6 @@ Please help me! I am afraid I lost myself in this place. I know there is a tempo
},
}
--------------------------------------------------------------------------------
-- Quest code
--------------------------------------------------------------------------------
......@@ -337,6 +336,9 @@ on_grant = function(self, who)
self.on_grant = nil
local hd = {"Quest:escort:assign", possible_types=possible_types}
if self:triggerHook(hd) then possible_types = hd.possible_types end
while true do
self.kind = rng.table(possible_types)
if rng.percent(self.kind.chance) then break 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