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

Fixed giving the staff of absorption to the apprentice mage (and added some more effects to it)

git-svn-id: http://svn.net-core.org/repos/t-engine4@2657 51575b47-30f0-44d4-a5cc-537603b46e54
parent d44964eb
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@ Good day to you, fellow traveler!]],
{"I found this artefact; it looks powerful. Maybe it would be enough?",
jump="unique",
cond=function(npc, player) return player:hasQuest("mage-apprentice") and player:hasQuest("mage-apprentice"):can_offer_unique(player) end,
action=function(npc, player, dialog) player:hasQuest("mage-apprentice"):collect_staff_unique(player, dialog) end
action=function(npc, player, dialog) player:hasQuest("mage-apprentice"):collect_staff_unique(npc, player, dialog) end
},
-- Reward for non-mages: access to Angolwen
{"So you have enough magical items now?",
......
......@@ -51,15 +51,6 @@ collect_staff = function(self, npc, who, dialog)
) and not o.unique
end,
function(o, item)
-- Special handling for the staff of absorption
if o.define_as and o.define_as == "STAFF_ABSORPTION" then
game.logPlayer(who, "#LIGHT_RED#As the apprentice touches the staff he begins to scream, flames bursting out of his mouth. Life seems to be drained away from him, and in an instant he collapses in a lifeless husk.")
who:setQuestStatus(self, self.FAILED)
game:unregisterDialog(dialog.next_dialog)
npc:die()
return true
end
self.nb_collect = self.nb_collect + 1
if self.nb_collect >= 10 then who:setQuestStatus(self, self.COMPLETED) end
who:removeObject(who:getInven("INVEN"), item)
......@@ -84,7 +75,7 @@ can_offer = function(self, who)
end
end
collect_staff_unique = function(self, who, dialog)
collect_staff_unique = function(self, npc, who, dialog)
who:showInventory("Offer which item?", who:getInven("INVEN"),
function(o) return (
(o.type == "weapon" and o.subtype == "staff") or
......@@ -93,6 +84,16 @@ collect_staff_unique = function(self, who, dialog)
) and o.unique
end,
function(o, item)
-- Special handling for the staff of absorption
if o.define_as and o.define_as == "STAFF_ABSORPTION" then
game.logPlayer(who, "#LIGHT_RED#As the apprentice touches the staff he begins to scream, flames bursting out of his mouth. Life seems to be drained away from him, and in an instant he collapses in a lifeless husk.")
who:setQuestStatus(self, self.FAILED)
game:unregisterDialog(dialog.next_dialog)
game.level.map:particleEmitter(npc.x, npc.y, 3, "fireflash", {radius=3, tx=npc.x, ty=npc.y})
npc:die()
return true
end
self.nb_collect = self.nb_collect + 10
if self.nb_collect >= 10 then who:setQuestStatus(self, self.COMPLETED) end
who:removeObject(who:getInven("INVEN"), item)
......
......@@ -106,7 +106,7 @@ newTalent{
local x, y = self:getTarget(tg)
if not x or not y then return nil end
self:projectile(tg, x, y, DamageType.FIRE, self:spellCrit(t.getDamage(self, t)), function(self, tg, x, y, grids)
game.level.map:particleEmitter(x, y, tg.radius, "fireflash", {radius=tg.radius, grids=grids, tx=x, ty=y})
game.level.map:particleEmitter(x, y, tg.radius, "fireflash", {radius=tg.radius, tx=x, ty=y})
end)
game:playSoundNear(self, "talents/fireflash")
return true
......
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