This guy has 20.000 mana and uses disruption shield. Assuming I manage to do 20.000 damage, it would blow up in my face.
While I could always walk away, this just does not feel right (in fact I am inclined to cheat just to kill him).
Disruption shield uses mana instead of health when taking damage.

npcs.lua
Code: Select all
newEntity{ define_as = "SUPREME_ARCHMAGE_LINANIIL",
allow_infinite_dungeon = true,
type = "humanoid", subtype = "human",
display = "p",
faction = "angolwen",
name = "Linaniil, Supreme Archmage of Angolwen", color=colors.VIOLET, unique = true,
desc = [[A tall, pale woman dressed in a revealing silk robe. Her gaze is so intense it seems to burn.]],
level_range = {50, nil}, exp_worth = 2,
rank = 4,
size_category = 3,
female = true,
mana_regen = 120,
max_mana = 20000,
max_life = 750, life_rating = 34, fixed_rating = true,
infravision = 20,
stats = { str=10, dex=15, cun=42, mag=26, con=14 },
instakill_immune = 1,
teleport_immune = 1,
move_others=true,
combat_spellpower = 30,
anger_emote = "Remove @himher@!",
open_door = true,
autolevel = "caster",
ai = "tactical", ai_state = { talent_in=1, ai_move="move_astar", },
ai_tactic = resolvers.tactic"ranged",
resolvers.inscriptions(5, {}),
resolvers.inscriptions(1, {"manasurge rune"}),
body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 },
resolvers.drops{chance=100, nb=3, {ego_chance=100} },
resists = {[DamageType.FIRE]=100, [DamageType.LIGHTNING]=100},
resolvers.equip{
{type="weapon", subtype="staff", autoreq=true},
{type="armor", subtype="cloth", autoreq=true},
},
talent_cd_reduction = {all=23},
resolvers.talents{
[Talents.T_WILDFIRE]=5,
[Talents.T_FLAME]=5,
[Talents.T_FLAMESHOCK]=5,
[Talents.T_DANCING_FIRES]=5,
[Talents.T_COMBUST]=5,
[Talents.T_MANATHRUST]=5,
[Talents.T_ARCANE_POWER]=5,
[Talents.T_DISRUPTION_SHIELD]=5,
[Talents.T_FREEZE]=5,
[Talents.T_SHOCK]=5,
[Talents.T_TEMPEST]=5,
[Talents.T_HURRICANE]=5,
[Talents.T_ESSENCE_OF_SPEED]=5,
[Talents.T_PHASE_DOOR]=5,
[Talents.T_TELEPORT]=5,
[Talents.T_KEEN_SENSES]=5,
[Talents.T_PREMONITION]=5,
},
resolvers.sustains_at_birth(),
can_talk = "angolwen-leader",
}
Code: Select all
newTalent{
name = "Disruption Shield",
type = {"spell/arcane",4},
require = spells_req4, no_sustain_autoreset = true,
points = 5,
mode = "sustained",
cooldown = 30,
sustain_mana = 150,
tactical = { DEFEND = 2 },
getManaRatio = function(self, t) return 3 - self:combatTalentSpellDamage(t, 10, 200) / 100 end,
activate = function(self, t)
local power = t.getManaRatio(self, t)
self.disruption_shield_absorb = 0
game:playSoundNear(self, "talents/arcane")
return {
shield = self:addTemporaryValue("disruption_shield", power),
particle = self:addParticles(Particles.new("disruption_shield", 1)),
}
end,
deactivate = function(self, t, p)
self:removeParticles(p.particle)
self:removeTemporaryValue("disruption_shield", p.shield)
self.disruption_shield_absorb = nil
return true
end,
info = function(self, t)
local power = t.getManaRatio(self, t)
return ([[Uses mana instead of life to take damage. Uses %0.2f mana per damage point taken.
If your mana is brought too low by the shield, it will de-activate and the chain reaction will release a deadly arcane explosion of the amount of damage absorbed.
The damage to mana ratio increases with the Magic stat]]):
format(power)
end,
}