øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1830.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexf6f1.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&board=8.180e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexf6f1.html.zx<&h^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈЋá§OKtext/htmlISO-8859-1gzip8:Öá§ÿÿÿÿÿÿÿÿWed, 11 Mar 2020 00:00:21 GMT0ó°° ®0®P®€§²ð®<&h^á§ New Skill Help

Author Topic: New Skill Help  (Read 1478 times)

TheNattak

  • Garula
  • *
  • Posts: 203
  • Gender: Male
  • Mike
    • View Profile
    • Return of the Dark Sorcerer
New Skill Help
« on: May 27, 2013, 07:12:18 PM »
Sorry to blow up the board with yet another question, but I'm hoping somebody here who has more experience than I with assembly may be able to lend a helping hand.

OK, what I'm trying to do is have a skill that inflicts damage equal to the users current HP and also throw out a random status ailment out of the ones checked, like Mantra combined with Evil Toot. I am using the Shock Skill as a base for this, and using Mantra as the 'extra effect'.

Here is the edited Mantra code:
C2/4263: 9C 14 34 STZ $3414    (Set to not modify damage)
C2/4266: 20 CB 3B JSR $3BCB    (Sets a random status from attack data) [jump to Evil Toot]
C2/4269: B9 F4 3B LDA $3BF4,Y  (Load HP)
C2/426C: 8D B0 11 STA $11B0    (Set damage)
C2/426F: 60 RTS

The damage part works fine, the problem I'm having is that the 'extra effect' of the Evil Toot is attacking the caster/character instead of the monster... It seems to be jumping to the Evil Toot routine and executing it, but switching the target to the caster. There seems to be no targeting being set in either of the two skills, so jumping from one skill to another shouldn't make any difference so I'm confused as to why it's not working.

Any ideas?
« Last Edit: May 27, 2013, 07:24:58 PM by TheNattak »

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: New Skill Help
« Reply #1 on: May 28, 2013, 01:20:45 AM »
the functions reached from Table C2/42E1 are the once-per-strike special effects.  those pointed to by C2/3DCD are the once-per-target special effects.  add a Mantra function of the latter category that calls Evil Toot.

TheNattak

  • Garula
  • *
  • Posts: 203
  • Gender: Male
  • Mike
    • View Profile
    • Return of the Dark Sorcerer
Re: New Skill Help
« Reply #2 on: May 28, 2013, 01:58:08 PM »
Hey, thanks a lot for helping out, assassin. Please bare with me I am really new to assembly, but am trying to learn through small ventures like this and expert assistance from folks like you (and Leno) =)

OK, I see the Mantra pointer in the once-per-strike table here:
C2/430B: 63 42 ($15)

So that's the one usme is pointing to I take it, the one I currently have implemented.
What I take away from your response is I need to have the special effect instead point to the once-per-target pointer table where I should add a new Mantra function there which would in-turn correct the targeting issue I'm having.

I'm not seeing anything with a Mantra function in the once-per-target list though, or how to implement one at that, so I'm a little confused off right off the bat how to go about it. I can't wrap my head around it.

What I did try though is I used one of the special effects from the once-per-target list that leads to an RTS in both tables that I assume to be unused: C2/3DCF: 8C 38 and re-pointed it to my Mantra code that calls Evil Toot, and then set that one as the added effect for my skill/spell in usme. But that's not working at all and I feel like I may be straying from the intended path and wasting time. In other words I must not being doing what you are suggesting.

Sorry for most likely making this seem harder than it is! That's my specialty...
« Last Edit: May 28, 2013, 02:24:48 PM by TheNattak »

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: New Skill Help
« Reply #3 on: May 28, 2013, 04:23:09 PM »
Change C2/3DF7 to point to 3BCB .  Keep your C2/4263 function, but drop the "JSR $3BCB".

TheNattak

  • Garula
  • *
  • Posts: 203
  • Gender: Male
  • Mike
    • View Profile
    • Return of the Dark Sorcerer
Re: New Skill Help
« Reply #4 on: May 28, 2013, 05:58:33 PM »
Alrighty, well now the Evil Toot effect is working good, but the Mantra effect of doing damage = to current HP is not, it's just doing base damage. =(

I changed C2/3DF7 to point to C2/3BCB, and took out the JSR $3BCB from my code which now looks like this:

C2/4263: 9C 14 34 STZ $3414    (Set to not modify damage)
C2/4269: B9 F4 3B LDA $3BF4,Y  (Load HP)
C2/426C: 8D B0 11 STA $11B0    (Set damage)
C2/426F: 60 RTS

And I still have the added effect for the skill set to Mantra in usme.

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: New Skill Help
« Reply #5 on: May 28, 2013, 07:34:19 PM »
When removing the JSR, did you replace it with 3 NOPs?  Normally, I wouldn't harp on your pasted instruction addresses, because that would make me a dick, but it's worth asking, given the damage failure is puzzling me.

TheNattak

  • Garula
  • *
  • Posts: 203
  • Gender: Male
  • Mike
    • View Profile
    • Return of the Dark Sorcerer
Re: New Skill Help
« Reply #6 on: May 28, 2013, 08:07:00 PM »
Ah no problem at all, I did not replace the JSR there with NOPs, I just wrote over it. My bad, I forgot to take the addresses into consideration when pasting the code again.

EDIT!:

And hooray it's working now! It just needed more of the original Mantra code in there, the shortened 'optimized' code of Mantra I was using was hindering it I guess. Thank you very much assassin!

« Last Edit: May 28, 2013, 08:27:48 PM by TheNattak »

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: New Skill Help
« Reply #7 on: May 28, 2013, 10:20:43 PM »
no prob.  ah, i didn't stop to think that things like the "REP #$20" were missing.