[1.0.4] Stunned by madness LUA error

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
ibanix
Wyrmic
Posts: 244
Joined: Thu May 23, 2013 12:25 am

[1.0.4] Stunned by madness LUA error

#1 Post by ibanix »

To reproduce:

1) Equip the artifact Anmalice
2) Smack creatures until one has the 'Stunned by madness' status
3) Try to use 'Inspect creature'

-> LUA error
Please help with the ToME wiki!

Crim, The Red Thunder
Sher'Tul Godslayer
Posts: 2000
Joined: Fri May 07, 2004 8:26 pm
Location: Nahgharash

Re: [1.0.4] Stunned by madness LUA error

#2 Post by Crim, The Red Thunder »

Does regular doomed 'stunned by madness' produce this as well? Never ran across it while playing, or is this a different 'stunned by madness' effect?
Currently playing under the name Aura of the Dawn 4 down, 227 to go!
Proud author of Orc Pit Restoration Project, Faction Allies, Dwarven Adventurer addons
SadistSquirrel wrote:DarkGod has two arms, one with an opened hand, one with a closed fist. You got the fist.

ibanix
Wyrmic
Posts: 244
Joined: Thu May 23, 2013 12:25 am

Re: [1.0.4] Stunned by madness LUA error

#3 Post by ibanix »

To be honest, I don't know. I don't play Doomed much.
Please help with the ToME wiki!

Hachem_Muche
Uruivellas
Posts: 744
Joined: Thu Nov 18, 2010 6:42 pm

Re: [1.0.4] Stunned by madness LUA error

#4 Post by Hachem_Muche »

This is caused by a missing parameter in the artifact definition. The following patch fixes the problem (-25 mental resist is assumed to be similar in value to -10 all resists), adds a default to the Madness Stun effect and fixes a tooltip error:

Code: Select all

 game/modules/tome/data/general/objects/world-artifacts.lua | 2 +-
 game/modules/tome/data/timed_effects/mental.lua | 4 ++--
 2 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/game/modules/tome/data/general/objects/world-artifacts.lua b/game/modules/tome/data/general/objects/world-artifacts.lua
index 0dc376a..99cd466 100644
--- a/game/modules/tome/data/general/objects/world-artifacts.lua
+++ b/game/modules/tome/data/general/objects/world-artifacts.lua
@@ -3650,7 +3650,7 @@ newEntity{ base = "BASE_LONGSWORD",
 			local eff = rng.table{"stun", "malign", "agony", "confusion", "silence",}
 			if not target:canBe(eff) then return end
 			if not who:checkHit(who:combatMindpower(), target:combatMentalResist()) then return end
-			if eff == "stun" then target:setEffect(target.EFF_MADNESS_STUNNED, 3, {})
+			if eff == "stun" then target:setEffect(target.EFF_MADNESS_STUNNED, 3, {mindResistChange=-25})
 			elseif eff == "malign" then target:setEffect(target.EFF_MALIGNED, 3, {resistAllChange=10})
 			elseif eff == "agony" then target:setEffect(target.EFF_AGONY, 5, { source=who, damage=40, mindpower=40, range=10, minPercent=10, duration=5})
 			elseif eff == "confusion" then target:setEffect(target.EFF_CONFUSED, 3, {power=60})

diff --git a/game/modules/tome/data/timed_effects/mental.lua b/game/modules/tome/data/timed_effects/mental.lua
index 07acbdd..6cddca3 100644
--- a/game/modules/tome/data/timed_effects/mental.lua
+++ b/game/modules/tome/data/timed_effects/mental.lua
@@ -862,11 +862,11 @@ newEffect{
 newEffect{
 	name = "MADNESS_STUNNED", image = "effects/madness_stunned.png",
 	desc = "Stunned by madness",
-	long_desc = function(self, eff) return ("Madness has stunned the target, reducing damage by 70%%, lowering mind resistance by %d%%, putting random talents on cooldown and reducing movement speed by 50%%. While stunned talents do not cooldown."):format(eff.mindResistChange) end,
+	long_desc = function(self, eff) return ("Madness has stunned the target, reducing damage by 70%%, lowering mind resistance by %d%%, putting random talents on cooldown and reducing movement speed by 50%%. While stunned talents do not cooldown."):format(-eff.mindResistChange) end,
 	type = "mental",
 	subtype = { madness=true, stun=true },
 	status = "detrimental",
-	parameters = {},
+	parameters = {mindResistChange = -10},
 	on_gain = function(self, err) return "#F53CBE##Target# is stunned by madness!", "+Stunned" end,
 	on_lose = function(self, err) return "#Target# overcomes the madness", "-Stunned" end,
 	activate = function(self, eff)
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

breadsmith
Thalore
Posts: 169
Joined: Fri May 17, 2013 6:15 am

Re: [1.0.4] Stunned by madness LUA error

#5 Post by breadsmith »

Anmalice is bugged in general, I think. I had a character use it for a while once, and even after transmogging it, it would occasionally stun either me or an enemy mob. It also somehow did enough mind damage that my wyrmic with no mind damage powers managed to pick up Mental Tyranny.

Post Reply