Enhancing Sword Latent Effects and Enspell day/weather bonus

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

Re: Enhancing Sword Latent Effects and Enspell day/weather b

Post by maxtherabbit » Tue Dec 10, 2013 10:23 pm

if you wanna point me in the right direction for scripting the additional effects, I can start working on that instead of putting more effort into the temp stuff

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

Re: Enhancing Sword Latent Effects and Enspell day/weather b

Post by kjLotus » Tue Dec 10, 2013 10:31 pm

maxtherabbit wrote:if you wanna point me in the right direction for scripting the additional effects, I can start working on that instead of putting more effort into the temp stuff
there's still a lot that has to be done before we can start scripting them, we'll have to see what i can do this weekend

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

Re: Enhancing Sword Latent Effects and Enspell day/weather b

Post by maxtherabbit » Tue Dec 10, 2013 11:27 pm

kjLotus wrote:
maxtherabbit wrote:maybe create a function for the day/weather stuff...
don't bother, there already is functions for all of that in the scripts, which is where additional effects are going to end up eventually

just doing enspells as a temp thing for now
actually looking at the magic.lua, the current functions for magic bonuses (addBonuses and addBonusesAbility) do not have a provision for magical damage which is irrespective of MAB/MDB like enspells and elemental additional effects on weapons

also I'm seeing that the target's elemental resistances are being factored in twice to the current magic calculations:

first in the applyResistance function where it boosts their magic evasion

Code: Select all

local magiceva = target:getMod(MOD_MEVA) + target:getMod(resistMod[spell:getElement()]);
this is compared to the caster's magic acc and ultimately results in the target being able to resist damage on a tiered basis 1/2 1/4 etc.

then again in the addBonuses function where it reduces dmg by an additional percentage based on the target's elemental resistance:

Code: Select all

local speciesReduction = target:getMod(defenseMod[ele]);
speciesReduction = 1.00 - (speciesReduction/1000);
dmg = math.floor(dmg * speciesReduction);
the defenseMod and resistMod are actually pulling from the exact same SQL field:

Code: Select all

resistMod = {MOD_FIRERES, MOD_EARTHRES, MOD_WATERRES, MOD_WINDRES, MOD_ICERES, MOD_THUNDERRES, MOD_LIGHTRES, MOD_DARKRES};
defenseMod = {MOD_FIREDEF, MOD_EARTHDEF, MOD_WATERDEF, MOD_WINDDEF, MOD_ICEDEF, MOD_THUNDERDEF, MOD_LIGHTDEF, MOD_DARKDEF};

Code: Select all

PMob->setModifier(MOD_FIREDEF,    (int16)((Sql_GetFloatData(SqlHandle, 38) - 1) * -1000)); // These are stored as floating percentages
PMob->setModifier(MOD_ICEDEF,     (int16)((Sql_GetFloatData(SqlHandle, 39) - 1) * -1000)); // and need to be adjusted into modifier units.
PMob->setModifier(MOD_WINDDEF,    (int16)((Sql_GetFloatData(SqlHandle, 40) - 1) * -1000)); // Higher DEF = lower damage.
PMob->setModifier(MOD_EARTHDEF,   (int16)((Sql_GetFloatData(SqlHandle, 41) - 1) * -1000)); // Negatives signify increased damage.
PMob->setModifier(MOD_THUNDERDEF, (int16)((Sql_GetFloatData(SqlHandle, 42) - 1) * -1000)); // Positives signify reduced damage.
PMob->setModifier(MOD_WATERDEF,   (int16)((Sql_GetFloatData(SqlHandle, 43) - 1) * -1000)); // Ex: 125% damage would be 1.25, 50% damage would be 0.50
PMob->setModifier(MOD_LIGHTDEF,   (int16)((Sql_GetFloatData(SqlHandle, 44) - 1) * -1000)); // (1.25 - 1) * -1000 = -250 DEF
PMob->setModifier(MOD_DARKDEF,    (int16)((Sql_GetFloatData(SqlHandle, 45) - 1) * -1000)); // (0.50 - 1) * -1000 = 500 DEF

PMob->setModifier(MOD_FIRERES,    (int16)((Sql_GetFloatData(SqlHandle, 38) - 1) * -100)); // These are stored as floating percentages
PMob->setModifier(MOD_ICERES,     (int16)((Sql_GetFloatData(SqlHandle, 39) - 1) * -100)); // and need to be adjusted into modifier units.
PMob->setModifier(MOD_WINDRES,    (int16)((Sql_GetFloatData(SqlHandle, 40) - 1) * -100)); // Higher RES = lower damage.
PMob->setModifier(MOD_EARTHRES,   (int16)((Sql_GetFloatData(SqlHandle, 41) - 1) * -100)); // Negatives signify lower resist chance.
PMob->setModifier(MOD_THUNDERRES, (int16)((Sql_GetFloatData(SqlHandle, 42) - 1) * -100)); // Positives signify increased resist chance.
PMob->setModifier(MOD_WATERRES,   (int16)((Sql_GetFloatData(SqlHandle, 43) - 1) * -100));
PMob->setModifier(MOD_LIGHTRES,   (int16)((Sql_GetFloatData(SqlHandle, 44) - 1) * -100));
PMob->setModifier(MOD_DARKRES,    (int16)((Sql_GetFloatData(SqlHandle, 45) - 1) * -100));
the defense mod is just the resistmod *10

is this correct/intentional for the target to have two opportunities to reduce total damage received based on the same "stat"?

downloaded a syntax highlighting template for lua files in ultraedit in preparation, now I can finally read them all good

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

Re: Enhancing Sword Latent Effects and Enspell day/weather b

Post by kjLotus » Tue Dec 10, 2013 11:39 pm

maxtherabbit wrote:actually looking at the magic.lua, the current functions for magic bonuses (addBonuses and addBonusesAbility) do not have a provision for magical damage which is irrespective of MAB/MDB like enspells and elemental additional effects on weapons
minor change, isn't too hard
maxtherabbit wrote:is this correct/intentional for the target to have two opportunities to reduce total damage received based on the same "stat"?
yep

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

Re: Enhancing Sword Latent Effects and Enspell day/weather b

Post by maxtherabbit » Wed Dec 11, 2013 3:20 pm

could I get a quick rundown of why there are two different identifiers/usages of the same DB value? and knowing how they are sourced for PCs would be awesome ;)

I don't see anything on the retail ffxi wiki page for calculating magic damage that discusses a 2 stage resist calculation, they seem to indicate that resistance is a single calculation so I'm confused

my thinking regarding additional effects, is since they aren't subject to MAB/MDB or the magic shell effect that they would not be subject to a magic acc vs magic eva resistance test at all, but instead would only receive a fixed percentage damage reduction/penalty based on the target's resistance value. it's been a while but I don't remember my magic acc as retail rdm affecting enspell damage at all either.

agree or disagree?

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

Re: Enhancing Sword Latent Effects and Enspell day/weather b

Post by kjLotus » Wed Dec 11, 2013 3:43 pm

maxtherabbit wrote:could I get a quick rundown of why there are two different identifiers/usages of the same DB value? and knowing how they are sourced for PCs would be awesome ;)
one is analogous to +element mods on gear (affects resists only), the other is just an increase/decrease in final elemental damage taken. most of the time these are 0, just for families that are strong/weak to a specific element are they changed

edit: for players, elemental evasion is +element on gear, and elemental defense is always 0
maxtherabbit wrote:my thinking regarding additional effects, is since they aren't subject to MAB/MDB or the magic shell effect that they would not be subject to a magic acc vs magic eva resistance test at all, but instead would only receive a fixed percentage damage reduction/penalty based on the target's resistance value.
the enspell page says that enspells can be resisted, which means they have a macc vs meva check that can randomly half/quarter/eighth damage

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

Re: Enhancing Sword Latent Effects and Enspell day/weather b

Post by maxtherabbit » Wed Dec 11, 2013 4:23 pm

kjLotus wrote:
the enspell page says that enspells can be resisted, which means they have a macc vs meva check that can randomly half/quarter/eighth damage
I don't think that's correct, because IIRC in retail melee jobs could sub RDM and still do some damage against tough+ mobs with enspell (granted it was less b/c of the low enhanging magic skill). if it was based on magic acc, wouldn't pure melee jobs relying solely on sub job magic skill get resisted almost constantly on tougher mobs?

I would assume that additional effect: elemental dmg weapons follow the same rules for resistance (they too can be resisted, but it is certainly not based on magic acc because there is no applicable magic skill lvl upon which to base the magic acc calculation)

thus why I was speculating that it's a fixed percentage penalty/bonus

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

Re: Enhancing Sword Latent Effects and Enspell day/weather b

Post by kjLotus » Wed Dec 11, 2013 4:26 pm

maxtherabbit wrote:(they too can be resisted, but it is certainly not based on magic acc because there is no applicable magic skill lvl upon which to base the magic acc calculation)
i have sirocco kukri (for example) scripted as having its base magic skill as dagger skill - it's also possible that it could just be assumed capped.

in any case, i have RDM49 on retail so i guess i could just go look

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

Re: Enhancing Sword Latent Effects and Enspell day/weather b

Post by maxtherabbit » Wed Dec 11, 2013 4:38 pm

yeah you should do some testing, my memory is not that reliable on this subject

some google digging has led me to believe that you're right about the enspells being able to be resisted 1/2 1/4 etc. but that the resistance calculations are done differently than regular spells (for example INT/MND have no role in them whatsoever)

some comments I saw on somebody's livejournal (lol) were talking about using the enspells to determine various mobs' "pure" resistance rates to a given element. perhaps the mob's inherent weakness/strength to the element in question is the only thing that controls their chances to resist by fraction (with rates diminishing on the increasing resist tiers)
Last edited by maxtherabbit on Wed Dec 11, 2013 4:44 pm, edited 1 time in total.

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

Re: Enhancing Sword Latent Effects and Enspell day/weather b

Post by kjLotus » Wed Dec 11, 2013 4:41 pm

not combat skill, was getting no resists with a club vs adoulin mobs

but i was getting some resists (6 damage instead of 12) with enblizzard against DC boars in kamihr, so its probably just assumed capped (i only have 160 enhancing skill as pup99/rdm49)

edit: and yeah, no int/mnd role probably, the script function for kukri already assumes 0 difference in int/mnd

Post Reply