Skip to content

Can Set Melee Effect (opcode 248) be used to increase the attacker's APR

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?

Comments

  • kjeronkjeron Member Posts: 2,367
    johnny5 said:

    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.

    Try setting the effects of this spell to target 9 (original caster).
  • johnny5johnny5 Member Posts: 5
    Thanks for the reply!

    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?
  • kjeronkjeron Member Posts: 2,367
    Yes, something is wrong, but couldn't tell you what without seeing the files.
  • johnny5johnny5 Member Posts: 5
    edited December 2017
    I have put them in a zip file and attached them to this message. If you have the time and don't mind taking a peek, I'd love to find this error. I've tried many combinations for the targets of these spells/effects, but perhaps I am overlooking something else entirely. I'm pretty new to modding. The filenames are FRENZY.SPL, FRENZY.EFF, and FRENZYI.SPL (the I stands for implementation).
  • kjeronkjeron Member Posts: 2,367
    Parameter2 of FRENZYI.SPL, its currently 65536, it should be 0.
  • johnny5johnny5 Member Posts: 5
    edited December 2017
    Wow, crazy. I could have sworn I had set that correctly before. But I fixed it, and now the ability works. Thanks a million!
  • johnny5johnny5 Member Posts: 5
    I think that in the process of implementing your earlier suggestion I must have accidentally mangled this value. LOL
  • DavideDavide Member, Moderator, Translator (NDA) Posts: 1,698
    Moved to the (I hope) proper section
Sign In or Register to comment.