Additional Effect via Scripting

User avatar
maxtherabbit
Developer
Posts: 57
Joined: Wed Jun 12, 2013 11:26 pm

Re: Additional Effect via Scripting

Post by maxtherabbit » Tue Dec 17, 2013 11:12 am

looking good lotus, did you decide to leave enspell dmg calculation in core or is it just temporary?

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Additional Effect via Scripting

Post by kjLotus » Tue Dec 17, 2013 6:35 pm

maxtherabbit wrote:looking good lotus, did you decide to leave enspell dmg calculation in core or is it just temporary?
i decided to leave it there, getting rid of the switch statement was good enough for me

User avatar
maxtherabbit
Developer
Posts: 57
Joined: Wed Jun 12, 2013 11:26 pm

Re: Additional Effect via Scripting

Post by maxtherabbit » Tue Dec 17, 2013 7:31 pm

I approve thoroughly

I fixed a arithmetic mistake you made in HandleEnspell() where the incorrect element # was being passed to the calc function for enlight/dark and tier2 elementals

I also changed the type casting where the day/weather bonus are being added to prevent unfair penalties due to truncation (i.e. 38+10% = 41 but 38-10%=34)

and made enspell damage subject to magic damage taken, damage taken, and phalanx modifiers before being passed to handlestoneskin

I added a test here if(damage<=0){return 0;} - this might seem stupid since damage in this function is unsigned but I just did it in case that ever gets changed

ppl on ds_oldschool were complaining about being hit for 655xx damage - I'm guessing this is a singed -> unsigned conversion somewhere gone wrong, maybe related to your expanding dmg to 32bit?

annd speaking of phalanx, the wiki has the incorrect formula for phalanx when enhancing skill is > 300

the correct formula is on the wiki talk page, as well as http://ffxi.gamerescape.com/wiki/Phalanx
I changed the phalanx script to reflect the correct formula, the wrong one that was copied from the wiki resulted in phalanx damage absorption immediately capping at 35 when you go over 300 skill which is completely wrong
Attachments
fixes.patch
(2.2 KiB) Downloaded 372 times

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Additional Effect via Scripting

Post by kjLotus » Tue Dec 17, 2013 9:04 pm

maxtherabbit wrote:I fixed a arithmetic mistake you made in HandleEnspell() where the incorrect element # was being passed to the calc function for enlight/dark and tier2 elementals
very possible, i didn't actually test them since they're technically not level 75 stuff
maxtherabbit wrote:I also changed the type casting where the day/weather bonus are being added to prevent unfair penalties due to truncation (i.e. 38+10% = 41 but 38-10%=34)
"unfair truncation" is usually how it works on retail, but i'll go double check it
maxtherabbit wrote:and made enspell damage subject to magic damage taken, damage taken, and phalanx modifiers before being passed to handlestoneskin
works for me, i thought phalanx was in handlestoneskin for some reason i guess
maxtherabbit wrote:I added a test here if(damage<=0){return 0;} - this might seem stupid since damage in this function is unsigned but I just did it in case that ever gets changed
currently debating whether i want to change it to a signed int to make absorbs work better (the way link did them is not entirely correct, plus i have to do elemental absorbs some time)
maxtherabbit wrote:ppl on ds_oldschool were complaining about being hit for 655xx damage - I'm guessing this is a singed -> unsigned conversion somewhere gone wrong, maybe related to your expanding dmg to 32bit?
kind of, more because guard could reduce pdif to a negative number, it just showed up now because of those changes though (and i've fixed it by now)
maxtherabbit wrote:annd speaking of phalanx, the wiki has the incorrect formula for phalanx when enhancing skill is > 300

the correct formula is on the wiki talk page, as well as http://ffxi.gamerescape.com/wiki/Phalanx
I changed the phalanx script to reflect the correct formula, the wrong one that was copied from the wiki resulted in phalanx damage absorption immediately capping at 35 when you go over 300 skill which is completely wrong
works for me

User avatar
maxtherabbit
Developer
Posts: 57
Joined: Wed Jun 12, 2013 11:26 pm

Re: Additional Effect via Scripting

Post by maxtherabbit » Tue Dec 17, 2013 9:08 pm

kjLotus wrote:
maxtherabbit wrote:I also changed the type casting where the day/weather bonus are being added to prevent unfair penalties due to truncation (i.e. 38+10% = 41 but 38-10%=34)
"unfair truncation" is usually how it works on retail
yes, the bonuses are still being truncated before being added to the damage, I just changed it to make the penalties also be truncated before being subtracted so 38+10% = 41 and 38-10%=35

I'm assuming this is how retail works? but idk for sure

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Additional Effect via Scripting

Post by kjLotus » Tue Dec 17, 2013 9:18 pm

maxtherabbit wrote:
kjLotus wrote:
maxtherabbit wrote:I also changed the type casting where the day/weather bonus are being added to prevent unfair penalties due to truncation (i.e. 38+10% = 41 but 38-10%=34)
"unfair truncation" is usually how it works on retail
yes, the bonuses are still being truncated before being added to the damage, I just changed it to make the penalties also be truncated before being subtracted so 38+10% = 41 and 38-10%=35

I'm assuming this is how retail works? but idk for sure
just tried - 22 damage normal enfire, 24 with firestorm, 19 with rainstorm

User avatar
maxtherabbit
Developer
Posts: 57
Joined: Wed Jun 12, 2013 11:26 pm

Re: Additional Effect via Scripting

Post by maxtherabbit » Tue Dec 17, 2013 9:23 pm

well I'll be damned... fuckin se man...

ok you can leave that bit out then :roll:

edit: here's the patch without that part
edit2:beat me to it!
Attachments
fixes.patch
(1.85 KiB) Downloaded 391 times

User avatar
maxtherabbit
Developer
Posts: 57
Joined: Wed Jun 12, 2013 11:26 pm

Re: Additional Effect via Scripting

Post by maxtherabbit » Wed Dec 18, 2013 11:18 am

I found a couple more things, these issues were already in the magic.lua before the addeffect changes:

the addBonuses and the addBonusesAbility functions both apply the dmgTaken and magicDmgTaken modifiers of the target to the damage. however the finalMagicAdjustments (and now also the finalMagicNonSpellAdjustments) functions also apply these same two modifiers before applying phalanx and passing the damage to ss

the dmgTaken and magicDmgTaken should only be applied one time per spell / effect and the should be calced last after all other magic bonuses before phalanx. so I took them out of the addbonus functions and left them in the final adjustment functions

also, magic shield doesn't affect additional effects so I took that out. in addition, I'm fairly sure that resistances for additional effects work the same as enspells (testing required) so the applyResistanceAddEffect should probably be reworked once someone creates a viable formula for the enspell resistances
Attachments
magic.lua.patch
(1.33 KiB) Downloaded 354 times

Davenge
Posts: 32
Joined: Tue Sep 17, 2013 5:29 pm

Re: Additional Effect via Scripting

Post by Davenge » Sun Apr 20, 2014 6:13 pm

So happy that in my hiatus, someone took over and ran with this. Cheers DDSP

Post Reply