diff --git a/game/modules/tome/class/interface/Combat.lua b/game/modules/tome/class/interface/Combat.lua index 97d8aa3c625afae675aa565eba5fda58c0f7c074..b7e990f899be4902375a7a98c83ae4ae832c6dae 100644 --- a/game/modules/tome/class/interface/Combat.lua +++ b/game/modules/tome/class/interface/Combat.lua @@ -492,6 +492,8 @@ function _M:attackTargetWith(target, weapon, damtype, mult, force_dam) repelled = true end + local no_procs = false + if repelled then self:logCombat(target, "#Target# repels an attack from #Source#.") elseif self:checkEvasion(target) then @@ -547,6 +549,16 @@ function _M:attackTargetWith(target, weapon, damtype, mult, force_dam) print("[ATTACK] dagger accuracy bonus", atk, def, "=", bonus, "apr ==>", apr) end + local hd = {"Combat:attackTargetWith:beforeArmor", target=target, weapon=weapon, damtype=damtype, mult=mult, dam=dam, apr=apr, atk=atk, def=def, armor=armor} + if self:triggerHook(hd) then + dam = hd.dam + damtype = hd.damtype + apr = hd.apr + armor = hd.armor + mult = hd.mult + no_procs = hd.no_procs + end + armor = math.max(0, armor - apr) dam = math.max(dam * pres - armor, 0) + (dam * (1 - pres)) print("[ATTACK] after armor", dam) @@ -646,7 +658,9 @@ function _M:attackTargetWith(target, weapon, damtype, mult, force_dam) end ]] - hitted = self:attackTargetHitProcs(target, weapon, dam, apr, armor, damtype, mult, atk, def, hitted, crit, evaded, repelled, old_target_life) + if not no_procs then + hitted = self:attackTargetHitProcs(target, weapon, dam, apr, armor, damtype, mult, atk, def, hitted, crit, evaded, repelled, old_target_life) + end -- Visual feedback if hitted then game.level.map:particleEmitter(target.x, target.y, 1, "melee_attack", {color=target.blood_color}) end diff --git a/game/modules/tome/data/general/npcs/gwelgoroth.lua b/game/modules/tome/data/general/npcs/gwelgoroth.lua index 34dd68a327faa1717b32a728204ac49c314ba6e8..bcef062e7cfd34827e9e0d54393383ade6b6fc25 100644 --- a/game/modules/tome/data/general/npcs/gwelgoroth.lua +++ b/game/modules/tome/data/general/npcs/gwelgoroth.lua @@ -54,7 +54,7 @@ newEntity{ newEntity{ base = "BASE_NPC_GWELGOROTH", name = "gwelgoroth", color=colors.AQUAMARINE, - desc = _t[[Gwelgoroth are mighty air elementals, torn away from their home world by a powerful magic.]], + desc = _t[[Gwelgoroth are mighty air elementals, a pure incarnation of lightning and thunder.]], level_range = {10, nil}, exp_worth = 1, rarity = 1, max_life = resolvers.rngavg(70,80), @@ -69,7 +69,7 @@ newEntity{ base = "BASE_NPC_GWELGOROTH", newEntity{ base = "BASE_NPC_GWELGOROTH", name = "greater gwelgoroth", color=colors.STEEL_BLUE, resolvers.nice_tile{image="invis.png", add_mos = {{image="npc/elemental_air_greater_gwelgoroth.png", display_h=2, display_y=-1}}}, - desc = _t[[Gwelgoroth are mighty air elementals, torn away from their home world by a powerful magic.]], + desc = _t[[Gwelgoroth are mighty air elementals, a pure incarnation of lightning and thunder.]], level_range = {12, nil}, exp_worth = 1, rarity = 3, max_life = resolvers.rngavg(70,80), life_rating = 10, @@ -86,7 +86,7 @@ newEntity{ base = "BASE_NPC_GWELGOROTH", newEntity{ base = "BASE_NPC_GWELGOROTH", name = "ultimate gwelgoroth", color=colors.ROYAL_BLUE, resolvers.nice_tile{image="invis.png", add_mos = {{image="npc/elemental_air_ultimate_gwelgoroth.png", display_h=2, display_y=-1}}}, - desc = _t[[Gwelgoroth are mighty air elementals, torn away from their home world by a powerful magic.]], + desc = _t[[Gwelgoroth are mighty air elementals, a pure incarnation of lightning and thunder.]], level_range = {15, nil}, exp_worth = 1, rarity = 5, rank = 3,