Page 1 of 1

[1.0.4] Stunned by madness LUA error

Posted: Fri Jun 14, 2013 7:37 am
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

Re: [1.0.4] Stunned by madness LUA error

Posted: Fri Jun 14, 2013 7:53 am
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?

Re: [1.0.4] Stunned by madness LUA error

Posted: Fri Jun 14, 2013 10:35 am
by ibanix
To be honest, I don't know. I don't play Doomed much.

Re: [1.0.4] Stunned by madness LUA error

Posted: Fri Jun 14, 2013 7:20 pm
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)

Re: [1.0.4] Stunned by madness LUA error

Posted: Sat Jun 15, 2013 3:45 am
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.