New lua marker MonsterOnTrigger, which creates a monster when the triggering condition is met (which currently only includes a monster dying).
Use it in the dis_mu Dis:7 vault to turn all of the iron statues into iron golems when Dispater dies.
SCSR2JCKKLSCW32G4HMJT5FMK3BJVATHSUFUU6QT6I4WLHAQWQQQC B4OL3ONAGXH7AKFUAMQSWSHSTLRK3BJI4A3D22W7MKTCAMDGIP6AC KI7ALE2ELEJRP5PMS76ZGODKZD2PK46NI3QKWBJM22VGC6JUNXJAC H3552BCIAVBLKAYKE4DHFLBLFW5RGRMYBMRRYHYEB5IPIJRUVU5QC BEJPFLSQYOLJETSLYRTROTRPJZEJDROGDX7MLBCWJLMIRZQBLEYQC 7Y5HSDFKA5TPLS2TWTRFMQVX6UXUDHXU5MUMXQSDFAIY4THQ3BIQC HNXKX6ZDQJV33E7UKZOLBYWJMRZ4QLEMXVXJZNRCTOIG2KVRTIEAC ----------------------------------------------------------------------------- lm_monst.lua-- Create a monster on certain events------------------------------------------------------------------------------------------------------------------------------------------------------------------ This marker creates a monster on certain events. It uses the following parameters:---- * death_monster: The name of the monster who's death triggers the creation of-- the new monster.---- * new_monster: The name of the monster to create.---- * message: Message to give when monster is created, regardless of whether-- or not the player can see the marker.---- * message_seen: Message to give if the player can see the marker.---- * message_unseen: Message to give if the player can't see the marker.---- NOTE: If the feature where the marker is isn't habitable by the new monster,-- the feature will be changed to the monster's primary habitat.---------------------------------------------------------------------------------------- TODO:-- * Place more than one monster.-- * Place monster displaced from marker.MonsterOnTrigger = { CLASS = "MonsterOnTrigger" }MonsterOnTrigger.__index = MonsterOnTriggerfunction MonsterOnTrigger:_new()local pm = { }setmetatable(pm, self)self.__index = selfreturn pmendfunction MonsterOnTrigger:new(pars)pars = pars or { }if not pars.death_monster or pars.death_monster == "" thenerror("Must provide death_monster")endif not pars.new_monster or pars.new_monster == "" thenerror("Must provide new_monster")endpars.message_seen = pars.message_seen or pars.message or ""pars.message_unseen = pars.message_unseen or pars.message or ""local pm = self:_new()pm.message_seen = pars.message_seenpm.message_unseen = pars.message_unseenpm.death_monster = pars.death_monsterpm.new_monster = pars.new_monsterpm.props = parsreturn pmendfunction MonsterOnTrigger:property(marker, pname)return self.props[pname] or ''endfunction MonsterOnTrigger:write(marker, th)lmark.marshall_table(th, self)endfunction MonsterOnTrigger:read(marker, th)return MonsterOnTrigger:new(lmark.unmarshall_table(th))endfunction MonsterOnTrigger:activate(marker)dgn.register_listener(dgn.dgn_event_type('monster_dies'), marker)endfunction MonsterOnTrigger:event(marker, ev)local midx = ev:arg1()local mons = dgn.mons_from_index(midx)if not mons thenerror("MonsterOnTrigger:event() didn't get a valid monster index")endif mons.name == self.death_monster thenlocal x, y = marker:pos()local you_x, you_y = you.pos()if x == you_x and y == you_y thenreturnend-- you.losight() seems to be necessary if the player has been moved by-- a wizard command and then the marker triggered by another wizard-- command, since then no turns will have been taken and the LOS info-- won't have been updated.you.losight()local see_grid = you.see_grid(x, y)if (not dgn.create_monster(x, y, self.new_monster)) thenreturnelseif self.message_seen ~= "" and see_grid thencrawl.mpr(self.message_seen)elseif self.message_unseen ~= "" and not see_grid thencrawl.mpr(self.message_unseen)enddgn.remove_listener(marker)dgn.remove_marker(marker)endendfunction monster_on_trigger(pars)return MonsterOnTrigger:new(pars)end