Skip to content
Snippets Groups Projects
Commit 644c96c1 authored by dg's avatar dg
Browse files

If Aeryn is killed before the endgame she will not be there to help

git-svn-id: http://svn.net-core.org/repos/t-engine4@4096 51575b47-30f0-44d4-a5cc-537603b46e54
parent bf25c941
No related branches found
No related tags found
No related merge requests found
......@@ -1347,6 +1347,7 @@ function _M:die(src)
if self.rank > 3 then
game.state:bossKilled(self.rank)
end
if self.unique then game.state:registerUniqueDeath(self) end
if self.on_death_lore then game.player:learnLore(self.on_death_lore) end
......
......@@ -31,6 +31,7 @@ function _M:init(t, no_default)
self.allow_backup_guardians = {}
self.world_artifacts_pool = {}
self.unique_death = {}
self.boss_killed = 0
self.stores_restock = 1
self.east_orc_patrols = 4
......@@ -47,6 +48,17 @@ function _M:bossKilled(rank)
self.boss_killed = self.boss_killed + 1
end
--- Sets unique as dead
function _M:registerUniqueDeath(u)
if u.randboss then return end
self.unique_death[u.name] = true
end
--- Is unique dead?
function _M:isUniqueDead(name)
return self.unique_death[name]
end
--- Allow dropping the rod of recall
function _M:allowRodRecall(v)
if v == nil then return self.allow_drop_recall end
......@@ -1288,6 +1300,7 @@ function _M:createRandomBoss(base, data)
local name = ngd:generate()
b.name = name.." the "..b.name
b.unique = b.name
b.randboss = true
local boss_id = "RND_BOSS_"..b.name:upper():gsub("[^A-Z]", "_")
b.define_as = boss_id
b.color = colors.VIOLET
......
......@@ -23,6 +23,8 @@ local function void_portal_open(npc, player)
return true
end
local function aeryn_alive(npc, player)
if game.state:isUniqueDead("High Sun Paladin Aeryn") then return false end
-- Charred scar was successful
if player:hasQuest("charred-scar") and player:hasQuest("charred-scar"):isCompleted("stopped") then return true end
......
......@@ -93,10 +93,12 @@ function end_end_combat(self)
end
function failed_charred_scar(self, level)
local aeryn = game.zone:makeEntityByName(level, "actor", "FALLEN_SUN_PALADIN_AERYN")
game.zone:addEntity(level, aeryn, "actor", level.default_down.x, level.default_down.y)
game.logPlayer(game.player, "#LIGHT_RED#As you enter the level you hear a familiar voice.")
game.logPlayer(game.player, "#LIGHT_RED#Fallen Sun Paladin Aeryn: '%s YOU BROUGHT ONLY DESTRUCTION TO THE SUNWALL! YOU WILL PAY!'", game.player.name:upper())
if not game.state:isUniqueDead("High Sun Paladin Aeryn") then
local aeryn = game.zone:makeEntityByName(level, "actor", "FALLEN_SUN_PALADIN_AERYN")
game.zone:addEntity(level, aeryn, "actor", level.default_down.x, level.default_down.y)
game.logPlayer(game.player, "#LIGHT_RED#As you enter the level you hear a familiar voice.")
game.logPlayer(game.player, "#LIGHT_RED#Fallen Sun Paladin Aeryn: '%s YOU BROUGHT ONLY DESTRUCTION TO THE SUNWALL! YOU WILL PAY!'", game.player.name:upper())
end
game:onLevelLoad("wilderness-1", function(zone, level)
local spot = level:pickSpot{type="zone-pop", subtype="ruined-gates-of-morning"}
......
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