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

wights

git-svn-id: http://svn.net-core.org/repos/t-engine4@459 51575b47-30f0-44d4-a5cc-537603b46e54
parent 36b411db
No related branches found
No related tags found
No related merge requests found
......@@ -67,7 +67,7 @@ end
-- If a levelup happens it calls self:levelup(), modules are encourraged to rewrite it to do whatever is needed.
function _M:gainExp(value)
if self.actors_max_level and self.level >= self.actors_max_level then return end
self.exp = self.exp + value
self.exp = math.max(0, self.exp + value)
while self:getExpChart(self.level + 1) and self.exp >= self:getExpChart(self.level + 1) and (not self.actors_max_level or self.level < self.actors_max_level) do
-- At max level, if any
if self.max_level and self.level >= self.max_level then break end
......
......@@ -706,6 +706,7 @@ end
function _M:canBe(what)
if what == "poison" and rng.percent(100 * (self:attr("poison_immune") or 0)) then return false end
if what == "cut" and rng.percent(100 * (self:attr("cut_immune") or 0)) then return false end
if what == "confusion" and rng.percent(100 * (self:attr("confusion_immune") or 0)) then return false end
if what == "blind" and rng.percent(100 * (self:attr("blind_immune") or 0)) then return false end
if what == "stun" and rng.percent(100 * (self:attr("stun_immune") or 0)) then return false end
if what == "fear" and rng.percent(100 * (self:attr("fear_immune") or 0)) then return false end
......
......@@ -324,7 +324,7 @@ newDamageType{
projector = function(src, x, y, type, dam)
local target = game.level.map(x, y, Map.ACTOR)
if target then
if target:checkHit((dam.power_check or src.combatSpellpower)(src), (dam.resist_check or target.combatSpellResist)(target), 0, 95, 15) and target:canBe("stun") then
if target:checkHit((dam.power_check or src.combatSpellpower)(src), (dam.resist_check or target.combatMentalResist)(target), 0, 95, 15) and target:canBe("confusion") then
target:setEffect(target.EFF_CONFUSED, dam.dur, {power=dam.dam})
else
game.logSeen(target, "%s resists!", target.name:capitalize())
......@@ -349,3 +349,20 @@ newDamageType{
end,
}
-- Drain Exp
newDamageType{
name = "drain experience", type = "DRAINEXP",
projector = function(src, x, y, type, dam)
if _G.type(dam) == "number" then dam = {dam=dam} end
DamageType:get(DamageType.BLIGHT).projector(src, x, y, DamageType.BLIGHT, dam.dam)
local target = game.level.map(x, y, Map.ACTOR)
if target then
if target:checkHit((dam.power_check or src.combatSpellpower)(src), (dam.resist_check or target.combatMentalResist)(target), 0, 95, 15) then
target:gainExp(-dam.dam*2)
game.logSeen(target, "%s drains %s experience!", src.name:capitalize(), target.name)
else
game.logSeen(target, "%s resists!", target.name:capitalize())
end
end
end,
}
-- Wights had the power to confuse and paralyze
-- their icy grasp will sap willpower and drain exp
--
--they will have high treasure, but be *hard*
--in the books they could confuse and paralyze and sleep and bend lesser minds to do their will and cause fear. fear would be more of an aura (need to save against it, but realistically it would only be once).
-- they could also be mind affecting too :)
local Talents = require("engine.interface.ActorTalents")
newEntity{
define_as = "BASE_NPC_WIGHT",
type = "undead", subtype = "wights",
display = "W", color=colors.WHITE,
desc = [[These be white wights.]],
combat = { dam=resolvers.rngavg(9,13), atk=10, apr=9, damtype=DamageType.DRAINEXP },
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 },
resolvers.drops{chance=20, nb=1, {} },
autolevel = "caster",
ai = "dumb_talented_simple", ai_state = { talent_in=4, },
energy = { mod=1 },
stats = { str=11, dex=11, mag=15, con=12 },
resolvers.tmasteries{ ["technique/other"]=0.3, ["spell/air"]=0.3, ["spell/fire"]=0.3 },
resists = { [DamageType.COLD] = 80, [DamageType.FIRE] = 20, [DamageType.LIGHTNING] = 40, [DamageType.PHYSICAL] = 35, [DamageType.LIGHT] = -50, },
poison_immune = 1,
blind_immune = 1,
see_invisible = 7,
undead = 1,
-- free_action = 1,
-- sleep_immune = 1,
}
newEntity{ base = "BASE_NPC_WIGHT",
name = "forest wight", color=colors.GREEN,
desc=[[It is a ghostly apparition with a humanoid form.]],
level_range = {16, 50}, exp_worth = 1,
rarity = 7,
max_life = resolvers.rngavg(40,50),
combat_armor = 7, combat_def = 6,
resolvers.talents{
[Talents.T_FLAMESHOCK]=1, [Talents.T_LIGHTNING]=1, [Talents.T_NOXIOUS_CLOUD]=1,
[Talents.T_MIND_DISRUPTION]=1,
},
}
newEntity{ base = "BASE_NPC_WIGHT",
name = "grave wight", color=colors.SLATE,
desc=[[It is a ghostly form with eyes that haunt you.]],
level_range = {22, 50}, exp_worth = 1,
rarity = 7,
max_life = resolvers.rngavg(70,80),
combat_armor = 9, combat_def = 6,
resolvers.talents{ [Talents.T_MANA_POOL]=1, [Talents.T_FLAMESHOCK]=2, [Talents.T_LIGHTNING]=2, [Talents.T_NOXIOUS_CLOUD]=2,
[Talents.T_MIND_DISRUPTION]=2,
},
}
newEntity{ base = "BASE_NPC_WIGHT",
name = "barrow wight", color=colors.VIOLET,
desc=[[It is a ghostly nightmare of an entity.]],
level_range = {25, 50}, exp_worth = 1,
rarity = 8,
max_life = resolvers.rngavg(80,90),
combat_armor = 10, combat_def = 8,
resolvers.talents{ [Talents.T_MANA_POOL]=1, [Talents.T_FLAMESHOCK]=3, [Talents.T_LIGHTNING]=3, [Talents.T_NOXIOUS_CLOUD]=3,
[Talents.T_MIND_DISRUPTION]=3,
},
}
newEntity{ base = "BASE_NPC_WIGHT",
name = "emperor wight", color=colors.RED,
desc=[[Your life force is torn from your body as this powerful unearthly being approaches.]],
level_range = {30, 50}, exp_worth = 1,
rarity = 9,
max_life = resolvers.rngavg(100,150),
combat_armor = 12, combat_def = 10,
resolvers.talents{ [Talents.T_MANA_POOL]=3, [Talents.T_FLAMESHOCK]=3, [Talents.T_LIGHTNING]=4, [Talents.T_NOXIOUS_CLOUD]=3, [Talents.T_THUNDERSTORM]=2,
[Talents.T_MIND_DISRUPTION]=4,
},
}
......@@ -45,6 +45,7 @@ newTalent{
type = {"wild-gift/sand-drake", 3},
require = gifts_req3,
points = 5,
message = "@Source@ shakes the ground!",
equilibrium = 4,
cooldown = 30,
tactical = {
......
......@@ -153,7 +153,7 @@ newTalent{
return true
end,
info = function(self, t)
return ([[Hits the target with your weapon doing %d%% damage, if the atatck hits, the target is stunned.]]):format(100 * (0.5 + self:getTalentLevel(t) / 10))
return ([[Hits the target with your weapon doing %d%% damage, if the attack hits, the target is stunned.]]):format(100 * (0.5 + self:getTalentLevel(t) / 10))
end,
}
......@@ -183,7 +183,7 @@ newTalent{
return true
end,
info = function(self, t)
return ([[Hits the target with your weapon doing %d%% damage, if the atatck hits, the target is knocked back.]]):format(100 * (1.5 + self:getTalentLevel(t) / 10))
return ([[Hits the target with your weapon doing %d%% damage, if the attack hits, the target is knocked back.]]):format(100 * (1.5 + self:getTalentLevel(t) / 10))
end,
}
......@@ -271,7 +271,7 @@ newTalent{
return true
end,
info = function(self, t)
return ([[Hits the target doing %d%% damage, if the atatck hits, the target is diseased.]]):format(100 * (0.5 + self:getTalentLevel(t) / 10))
return ([[Hits the target doing %d%% damage, if the attack hits, the target is diseased.]]):format(100 * (0.5 + self:getTalentLevel(t) / 10))
end,
}
......@@ -300,7 +300,7 @@ newTalent{
return true
end,
info = function(self, t)
return ([[Hits the target doing %d%% damage, if the atatck hits, the target is diseased.]]):format(100 * (0.5 + self:getTalentLevel(t) / 10))
return ([[Hits the target doing %d%% damage, if the attack hits, the target is diseased.]]):format(100 * (0.5 + self:getTalentLevel(t) / 10))
end,
}
......@@ -329,6 +329,25 @@ newTalent{
return true
end,
info = function(self, t)
return ([[Hits the target doing %d%% damage, if the atatck hits, the target is diseased.]]):format(100 * (0.5 + self:getTalentLevel(t) / 10))
return ([[Hits the target doing %d%% damage, if the attack hits, the target is diseased.]]):format(100 * (0.5 + self:getTalentLevel(t) / 10))
end,
}
newTalent{
name = "Mind Disruption",
type = {"spell/other", 1},
points = 5,
cooldown = 10,
mana = 16,
range = 20,
action = function(self, t)
local tg = {type="hit", range=self:getTalentRange(t), talent=t}
local x, y = self:getTarget(tg)
if not x or not y then return nil end
self:project(tg, x, y, DamageType.CONFUSION, {dur=2+self:getTalentLevel(t), dam=50+self:getTalentLevelRaw(t)*10}, {type="manathrust"})
return true
end,
info = function(self)
return ([[Try to confuse the target's mind fr a while.]])
end,
}
load("/data/general/npcs/skeleton.lua")
load("/data/general/npcs/ghoul.lua")
load("/data/general/npcs/wight.lua")
local Talents = require("engine.interface.ActorTalents")
......
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