Additional Effect via Scripting
- maxtherabbit
- Developer
- Posts: 57
- Joined: Wed Jun 12, 2013 11:26 pm
Re: Additional Effect via Scripting
looking good lotus, did you decide to leave enspell dmg calculation in core or is it just temporary?
Re: Additional Effect via Scripting
i decided to leave it there, getting rid of the switch statement was good enough for memaxtherabbit wrote:looking good lotus, did you decide to leave enspell dmg calculation in core or is it just temporary?
- maxtherabbit
- Developer
- Posts: 57
- Joined: Wed Jun 12, 2013 11:26 pm
Re: Additional Effect via Scripting
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
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 373 times
Re: Additional Effect via Scripting
very possible, i didn't actually test them since they're technically not level 75 stuffmaxtherabbit 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
"unfair truncation" is usually how it works on retail, but i'll go double check itmaxtherabbit 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)
works for me, i thought phalanx was in handlestoneskin for some reason i guessmaxtherabbit wrote:and made enspell damage subject to magic damage taken, damage taken, and phalanx modifiers before being passed to handlestoneskin
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: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
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: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?
works for memaxtherabbit 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
- maxtherabbit
- Developer
- Posts: 57
- Joined: Wed Jun 12, 2013 11:26 pm
Re: Additional Effect via Scripting
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%=35kjLotus wrote:"unfair truncation" is usually how it works on retailmaxtherabbit 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)
I'm assuming this is how retail works? but idk for sure
Re: Additional Effect via Scripting
just tried - 22 damage normal enfire, 24 with firestorm, 19 with rainstormmaxtherabbit wrote: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%=35kjLotus wrote:"unfair truncation" is usually how it works on retailmaxtherabbit 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)
I'm assuming this is how retail works? but idk for sure
- maxtherabbit
- Developer
- Posts: 57
- Joined: Wed Jun 12, 2013 11:26 pm
Re: Additional Effect via Scripting
well I'll be damned... fuckin se man...
ok you can leave that bit out then
edit: here's the patch without that part
edit2:beat me to it!
ok you can leave that bit out then
edit: here's the patch without that part
edit2:beat me to it!
- Attachments
-
- fixes.patch
- (1.85 KiB) Downloaded 391 times
- maxtherabbit
- Developer
- Posts: 57
- Joined: Wed Jun 12, 2013 11:26 pm
Re: Additional Effect via Scripting
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
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
Re: Additional Effect via Scripting
So happy that in my hiatus, someone took over and ran with this. Cheers DDSP