Page 1 of 1

setCauseCondition expects table

Posted: Sun May 26, 2024 4:41 pm
by DaggorathMaster
How does monsterAttack:setCauseCondition() work?
It expects a table.
But, of what?

I am interested in having monsters cause more than one condition,
e.g., spiders obviously poison, but IRL that poison causes paralysis,
so I would increase the base chance, and pick a condition randomly (weighted).

But the format for telling it a new condition, made its saving throw.

Re: setCauseCondition expects table

Posted: Sun May 26, 2024 8:23 pm
by 7Soul
Looks like another oversight in the scripting interface :/ It does expect a table when it should've been a string

A way of making it work would be to use the `onAttackHit(self, champion)` hook to manually apply the random condition, ignoring the causeCondition property entirely

Re: setCauseCondition expects table

Posted: Sat Jun 01, 2024 7:39 pm
by DaggorathMaster
I suppose I can settle for that if needed.
That approach does open the possibility of just reworking attack conditions entirely.

Re: setCauseCondition expects table

Posted: Thu Jun 06, 2024 6:16 am
by minmay
To emulate causeCondition, use the onDealDamage hook rather than the onAttackHit hook; causeCondition only causes conditions for attacks that deal damage, whereas onAttackHit is called even if the attack deals no damage (it's called before damage calculation, in fact).

Re: setCauseCondition expects table

Posted: Mon Jun 10, 2024 2:46 am
by DaggorathMaster
OK. Actually now I see that that is just what Dark Acolytes do - causeCondition for poison, and a hook for paralysis.

The choice of whether to use onDealDamage or onAttackHit can be made based one whether late-game heavily-armored champions are god-mode or still too vulnerable (pending playtesting).

I have been eyeing a conditions rework anyway (because of things like monster vs. monster fighting, and making the mod a worthy challenge/mind$cr3w for people who know the game a little too well.)
So maybe ignoring most or all of the "normal" way of doing it is in order.