Page 1 of 1

Enthunder no DMG to Water Elemental

Posted: Fri Aug 11, 2017 11:57 am
by Wiggo
Anyone know where the damage from enspells is managed? (LUA file or C++) The water Elementals in Pashhow Marshlands do not seem to want to take any damage from enthunder.

Re: Enthunder no DMG to Water Elemental

Posted: Sat Aug 12, 2017 9:55 am
by maxtherabbit
I just logged on my test server on latest DSP and fought one, they took the additional effect dmg from enthunder exactly as expected

Re: Enthunder no DMG to Water Elemental

Posted: Tue Aug 15, 2017 1:22 pm
by Wiggo
Figured I was doing something wrong so I set up an entirely new server on an entirely different computer system. Still doing the same thing for me. Some things I've noticed are I do get warnings all over the place when compiling the source code in Visual Studio Community 2017. "warning C4996: 'strcmpi' the POSIX name for this item is deprecated. Instead use the ISO C and C++ conformant name: _strcmpi. See online help for details." Though it still finishes successfully.

I've also noticed issues with certain outposts not initializing correctly. Could be related? For instance, the Buburimu outpost does not spawn the teleport npc. And when windurst has control there is a beastman banner sitting on top of the signet npc. I thought it was something I was doing wrong until I've confirmed this error on the LegionDark server by running up there with a new character and taking a peek. LegionDark displays the same erroneous outpost results.
Next, I went to Nasomi server and ran up to the outpost there and saw it is functioning normally. So, for right now I'm still working on trying to solve all of my issues... lol.

Re: Enthunder no DMG to Water Elemental

Posted: Tue Aug 15, 2017 3:10 pm
by Wiggo
Update: So, actually enspells do seem to work as they should. I messed it up in more ways than one. Not sure if I can explain everything I did wrong except to say that I believe the pure unmodified dsp build has the enspells working as they should...

however, I do not believe I should be able to nuke down a water elemental with fire and do just as much damage to it as a regular mob. They are 'supposed' to have a VERY HIGH resistance to fire, am I correct? And I am able to kill pretty much any elemental with the element of the spell it counters with relative ease on both of my servers. Is this something else I am doing wrong?

Re: Enthunder no DMG to Water Elemental

Posted: Tue Aug 15, 2017 5:35 pm
by maxtherabbit
I have also noticed that at least some elementals' resistances are off

i.e. you can nuke them with their own element in limbus

the elemental resistances are trivial to adjust in the database, if you can figure out which ones are wrong exactly and submit a PR I'll happily accept it

Re: Enthunder no DMG to Water Elemental

Posted: Tue Aug 15, 2017 7:19 pm
by Wiggo
looking in: src\map\utils\zoneutils.cpp Lines:480-487
I found the modifiers for the elemental resistances and noticed that they seemed to be set significantly lower than the weapontype resistance modifiers. So, just to see what happened I added an extra '0' to every elemental resistance to make the multiplier 1000 just like the weapontype multiplier. I rebuilt the server and I was able to control elemental resistance using the modifiers in the mob_family_system table in the database. It worked in that respect. No longer did the water elemental take much damage at all from Fire. But, ran into the problem with the enspells again. :shock: So, now I'm back to figuring out where the damage from the enspells is managed.

Re: Enthunder no DMG to Water Elemental

Posted: Thu Aug 17, 2017 12:55 pm
by Wiggo
You wouldn't happen to know where the calculation for the enspell damage is managed would you? I believe the formula is off as I am able to adjust the individual element resistances for mobs in the mob_family_system and no matter which way I move the multiplier (0.01 -> 3) it always increases resistance. But you can't tell either way unless you change the core elemental resistance formula in zoneutils.cpp to a more significant value (i.e. 1000 like the other resistances). I'll do the work, testing, submit a pr, etc. But, I'm just having trouble finding where the damage for enspells is managed.

Re: Enthunder no DMG to Water Elemental

Posted: Thu Aug 17, 2017 7:22 pm
by maxtherabbit
enspells are handled by battleutils::CalculateEnspellDamage

I'm 99% certain the formulas for them are not wrong, but you are welcome to review the math for yourself

Re: Enthunder no DMG to Water Elemental

Posted: Thu Aug 17, 2017 7:27 pm
by maxtherabbit
I have a suspicion that your confusion is coming from the fact that mobs have two different means of weakness/strength to elements

they have resistances (chance to resist to half, quarter, eighth, etc. like players)

they also have elemental defense which is a fixed multiplier against all damage they receive from that element (no player analog)

the weapontype resistance is a different base by design

Re: Enthunder no DMG to Water Elemental

Posted: Fri Aug 18, 2017 8:08 am
by Wiggo
Ahhhh... so what I am really looking for is the formula where the enspell 'resistance' is calculated (located). There's something off here and I'm getting close to figuring it out.