Can Set Melee Effect (opcode 248) be used to increase the attacker's APR
johnny5
Member Posts: 5
I am trying to create a potion with a 1 time use that has the following effect. Upon consumption, the character permanently has the following ability: Whenever they hit something, their APR increases by 1/2 for 30s. It is a kind of Frenzy or Blood Lust triggered by a successful melee attack. But I am not having any luck implementing this.
The potion itself seems fine. It casts a spell on the consumer. The spell has one instant/permanent, no dispel, 100% probability effect using opcode 248 and referencing an effect file. Though I am not sure whether I have correctly set the target for this spell effect. I have tried different targets to no avail.
For the effect file, I have tried making it two ways. The first way was a straightforward effect that implements an increment of 1/2 to the APR, targeted to Self with instant/limited duration of 30s.
That didn't work, so I tried the convoluted idea of using the effect to cast a spell (opcode 146), targeted at self. The spell then implements the APR increment. That didn't work either.
Is what I am trying possible? The opcodes page at iesdp states that the effect of opcode 248 will be applied to the target (and therefore not the attacker). So perhaps with this opcode, the engine ignores the targets and simply uses the target of the melee attack. Or, am I just missing the correct combination of target values for all these headers?
One other idea: My effect file targets the actual target of the melee hit and uses opcode 232 (to place a contingency on the target). That contingency uses condition 0 (HitBy()) and uses that to have the target of the melee hit cast the increase of APR back at the attacker. But it seems that then the effect would only apply to subsequent hits because the first hit would only set up the contingency (which could then be triggered by someone else hitting the target and getting the APR boost). So that doesn't seem very good.
Has anyone tried something like this before?
The potion itself seems fine. It casts a spell on the consumer. The spell has one instant/permanent, no dispel, 100% probability effect using opcode 248 and referencing an effect file. Though I am not sure whether I have correctly set the target for this spell effect. I have tried different targets to no avail.
For the effect file, I have tried making it two ways. The first way was a straightforward effect that implements an increment of 1/2 to the APR, targeted to Self with instant/limited duration of 30s.
That didn't work, so I tried the convoluted idea of using the effect to cast a spell (opcode 146), targeted at self. The spell then implements the APR increment. That didn't work either.
Is what I am trying possible? The opcodes page at iesdp states that the effect of opcode 248 will be applied to the target (and therefore not the attacker). So perhaps with this opcode, the engine ignores the targets and simply uses the target of the melee attack. Or, am I just missing the correct combination of target values for all these headers?
One other idea: My effect file targets the actual target of the melee hit and uses opcode 232 (to place a contingency on the target). That contingency uses condition 0 (HitBy()) and uses that to have the target of the melee hit cast the increase of APR back at the attacker. But it seems that then the effect would only apply to subsequent hits because the first hit would only set up the contingency (which could then be triggered by someone else hitting the target and getting the APR boost). So that doesn't seem very good.
Has anyone tried something like this before?
0
Comments
So I just tried that but it didn't work. Here is precisely what I tried. I have 3 files (4 including the potion .ITM file). The following names aren't the actual names, but they are better descriptors of their respective functions, so it is easier to list them this way.
1. endow-ability.SPL This one has the effect with opcode 248, instant/permanent targeted to 2 (preset target) and pointing to the next file. I have at least verified that this spell fires because I added a secondary effect to temporarily boost CON for 30s and it works. So at least the potion file is working as intended to call this spell.
2. melee-effect.EFF This one uses opcode 146, instant/perm, targeted to 2, 9, 1 (I tried them all), and pointing to the next file.
3. apr-boost.SPL This one has a single spell ability which is targeted at 5 (caster) and has a single effect. The effect is to increment APR by 1 per 2 rounds. Its target is 9 (original caster). I made it instant/permanent for testing purposes.
Still nothing though. Any other ideas? Am I doing something wrong?