Advertisement
Guest User

mess

a guest
Apr 27th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.28 KB | None | 0 0
  1. newTalent{
  2.     short_name = "MUST_KILL_ANOTHER",
  3.     name = "Must Kill Another",
  4.     --code altered from Inner Demons
  5.     type = {"race/Chrono_Xorn", 1},
  6.     points = 1,
  7.     mode = "passive",
  8.     require = racial_req1,
  9.     cooldown = 0,
  10.     paradox = 0,
  11.     range = 1000000,
  12.     direct_hit = true,
  13.     requires_target = true,
  14.     getChance = function(self, t)
  15.         return 50
  16.     end,
  17.     on_kill = function(self, t, target)
  18.         summon_inner_demons = function(self, target, t)
  19.             -- Find space
  20.             local x, y = util.findFreeGrid(target.x, target.y, 1, true, {[Map.ACTOR]=true})
  21.             if not x then
  22.                 return
  23.             end
  24.             --if target:attr("summon_time") then return end
  25.  
  26.             local m = target:cloneFull{
  27.                 shader = "shadow_simulacrum",
  28.                 shader_args = { color = {0.6, 0.0, 0.3}, base = 0.6, time_factor = 1500 },
  29.                 no_drops = false, keep_inven_on_death = false,
  30.                 faction = "enemies",
  31.                 summoner = self, summoner_gain_exp=false,
  32.                 summon_time = 1000000,
  33.                 ai_target = {actor=target},
  34.                 ai = "summoned", ai_real = "tactical",
  35.                 name = ""..target.name.."'s more dangerous self from another timeline",
  36.                 desc = [[A temporal clone that resembles the creature it came from but seems more dangerous.]],
  37.         }
  38.         m:removeAllMOs()
  39.         m.make_escort = nil
  40.         m.on_added_to_level = nil
  41.         m.on_added = nil
  42.  
  43.         mod.class.NPC.castAs(m)
  44.         engine.interface.ActorAI.init(m, m)
  45.  
  46.         m.exp_worth = 1
  47.         m.energy.value = 1
  48.         m.player = nil
  49.         m.max_life = m.max_life / 4 / m.rank
  50.         m.life = util.bound(m.life, 0, m.max_life)
  51.         m.inc_damage.all = (m.inc_damage.all or 0) - 50
  52.         m.forceLevelup = function() end
  53.         m.on_die = nil
  54.         m.die = nil
  55.         m.puuid = nil
  56.         m.on_acquire_target = nil
  57.         m.no_inventory_access = true
  58.         m.on_takehit = nil
  59.         m.seen_by = nil
  60.         m.can_talk = nil
  61.         m.clone_on_hit = nil
  62.         m.self_resurrect = nil
  63.         --if m.talents.T_SUMMON then m.talents.T_SUMMON = nil end
  64.         --if m.talents.T_MULTIPLY then m.talents.T_MULTIPLY = nil end
  65.        
  66.         -- Inner Demon's never flee
  67.         m.ai_tactic = m.ai_tactic or {}
  68.         m.ai_tactic.escape = 0
  69.        
  70.         -- Remove some talents
  71.         local tids = {}
  72.         for tid, _ in pairs(m.talents) do
  73.             local t = m:getTalentFromId(tid)
  74.             if t.no_npc_use then tids[#tids+1] = t end
  75.         end
  76.         for i, t in ipairs(tids) do
  77.             if t.mode == "sustained" and m:isTalentActive(t.id) then m:forceUseTalent(t.id, {ignore_energy=true}) end
  78.             m.talents[t.id] = nil
  79.         end
  80.        
  81.         -- remove detrimental timed effects
  82.         local effs = {}
  83.         for eff_id, p in pairs(m.tmp) do
  84.             local e = m.tempeffect_def[eff_id]
  85.             if e.status == "detrimental" then
  86.                 effs[#effs+1] = {"effect", eff_id}
  87.             end
  88.         end
  89.  
  90.         while #effs > 0 do
  91.             local eff = rng.tableRemove(effs)
  92.             if eff[1] == "effect" then
  93.                 m:removeEffect(eff[2])
  94.             end
  95.         end
  96.  
  97.         -- make more dangerous
  98.         inc_stats = { str=20, mag=20, wil=20, cun=20, dex=20, con=20, lck=20 },
  99.        
  100.         game.zone:addEntity(game.level, m, "actor", x, y)
  101.         game.level.map:particleEmitter(x, y, 1, "generic_teleport", {rm=60, rM=130, gm=20, gM=110, bm=90, bM=130, am=70, aM=180})
  102.  
  103.         game.logSeen(target, "#F53CBE#%s's more survivable self from another timeline manifests!", target.name:capitalize())
  104.        
  105.         end,
  106.     end,
  107.     info = function(self)
  108.         return ([[When you kill a creature, you have a 50 percent chance to summon its clone from another timeline, one that is more likely to survive.]])
  109.     end,
  110. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement