• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS new function; onStatsChange/onDamageReceived

Would this function be worth adding?

  • Yes

    Votes: 6 100.0%
  • No

    Votes: 0 0.0%

  • Total voters
    6
  • Poll closed .

Xikini

I whore myself out for likes
Senator
Premium User
Joined
Nov 17, 2010
Messages
6,756
Solutions
578
Reaction score
5,305
The idea is simple.

onHealthChange / onManaChange is when all calculations are completed, and the final amount +/- that the player is going to receive.

(name of functions pending... xD)
onStatsChange / onDamageReceived is before any calculations are completed.

Ideally this will only be a pass-thru function, where we are able to modify the damage/healing/modifier values before they are number crunched by the source.

args.. (creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin, modifiers)

modifiers -> anything in the source that can potentially modify the damage.
Such as.. item attributes(resistance, armor, block chance), critical chance/damage, et cetera

--
This function would be incredibly useful, since there is currently no simple way to get at damage values until after all these calculations are completed.
There are some things that are literally impossible to resolve without this function, and the reason I'm suggesting it.

--
Some quick scenario's off of the top of my head where this would be useful.

Event area creatures could get a damage boost depending on how many players were in the event.
-> (alternative would be to create custom spells for your event monsters)

Equipped items with modifications that boost/lower resistances.
-> (Currently impossible. Every alternative method has small to large issues. Some scenario's are possible, where others are not.)

Leech effects for the player could be based off of the initial damage instead of the damage taken.
-> (Alternative would be to have every weapon / spell modified to check for the damage and apply leech?)
-> (And you'd have to create your own leech attribute in Lua, otherwise you'd get double leech.)

--
As you can see there are some easily thought of scenario's where the effort : reward ratio would be minimized by the function and also other scenario's that are impossible to achieve without this function.

So, that's my idea.

Let me know what you think?
 
or maybe we could just add an optional parameter to onHealthChange/onManaChange so this part get executed later
You're right.

If it's possible to modify the current onHealthChange / onManaChange to fit the intended new function, this would be the ideal solution.

It makes sense as well, since the new / modified function can do everything the old function could not do, plus more.

I'm not a dev though. xP
Idk if there's a reason why we should or should not do something.
 
I think this has been a long desired feature of the community, but the dev team has always dismissed it as not needed , an enhancement that's not a priority.
 
Back
Top