Commit bfd8d6a22fca562f73e2339d691af5dd7244088a

Authored by dg
1 parent d44964eb

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
... ... @@ -46,7 +46,7 @@ Good day to you, fellow traveler!]],
46 46 {"I found this artefact; it looks powerful. Maybe it would be enough?",
47 47 jump="unique",
48 48 cond=function(npc, player) return player:hasQuest("mage-apprentice") and player:hasQuest("mage-apprentice"):can_offer_unique(player) end,
49   - action=function(npc, player, dialog) player:hasQuest("mage-apprentice"):collect_staff_unique(player, dialog) end
  49 + action=function(npc, player, dialog) player:hasQuest("mage-apprentice"):collect_staff_unique(npc, player, dialog) end
50 50 },
51 51 -- Reward for non-mages: access to Angolwen
52 52 {"So you have enough magical items now?",
... ...
... ... @@ -51,15 +51,6 @@ collect_staff = function(self, npc, who, dialog)
51 51 ) and not o.unique
52 52 end,
53 53 function(o, item)
54   - -- Special handling for the staff of absorption
55   - if o.define_as and o.define_as == "STAFF_ABSORPTION" then
56   - 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.")
57   - who:setQuestStatus(self, self.FAILED)
58   - game:unregisterDialog(dialog.next_dialog)
59   - npc:die()
60   - return true
61   - end
62   -
63 54 self.nb_collect = self.nb_collect + 1
64 55 if self.nb_collect >= 10 then who:setQuestStatus(self, self.COMPLETED) end
65 56 who:removeObject(who:getInven("INVEN"), item)
... ... @@ -84,7 +75,7 @@ can_offer = function(self, who)
84 75 end
85 76 end
86 77
87   -collect_staff_unique = function(self, who, dialog)
  78 +collect_staff_unique = function(self, npc, who, dialog)
88 79 who:showInventory("Offer which item?", who:getInven("INVEN"),
89 80 function(o) return (
90 81 (o.type == "weapon" and o.subtype == "staff") or
... ... @@ -93,6 +84,16 @@ collect_staff_unique = function(self, who, dialog)
93 84 ) and o.unique
94 85 end,
95 86 function(o, item)
  87 + -- Special handling for the staff of absorption
  88 + if o.define_as and o.define_as == "STAFF_ABSORPTION" then
  89 + 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.")
  90 + who:setQuestStatus(self, self.FAILED)
  91 + game:unregisterDialog(dialog.next_dialog)
  92 + game.level.map:particleEmitter(npc.x, npc.y, 3, "fireflash", {radius=3, tx=npc.x, ty=npc.y})
  93 + npc:die()
  94 + return true
  95 + end
  96 +
96 97 self.nb_collect = self.nb_collect + 10
97 98 if self.nb_collect >= 10 then who:setQuestStatus(self, self.COMPLETED) end
98 99 who:removeObject(who:getInven("INVEN"), item)
... ...
... ... @@ -106,7 +106,7 @@ newTalent{
106 106 local x, y = self:getTarget(tg)
107 107 if not x or not y then return nil end
108 108 self:projectile(tg, x, y, DamageType.FIRE, self:spellCrit(t.getDamage(self, t)), function(self, tg, x, y, grids)
109   - game.level.map:particleEmitter(x, y, tg.radius, "fireflash", {radius=tg.radius, grids=grids, tx=x, ty=y})
  109 + game.level.map:particleEmitter(x, y, tg.radius, "fireflash", {radius=tg.radius, tx=x, ty=y})
110 110 end)
111 111 game:playSoundNear(self, "talents/fireflash")
112 112 return true
... ...