#Override ability special on items
1 messages · Page 1 of 1 (latest)
you can refresh value manually with item:RefreshIntrinsicModifier()
but as i know items didn't update value in tooltip
i believe you need to call OnUnequip and OnEquip (unintuitive naming, these are not events)
to simulate dropping the item and picking it back up to refresh the values.
if you just refresh the modifier it does not guarantee any value gets updated because the modifier would have to handle that in its OnRefresh function.
Found 1 function for onunequip
🇸 CDOTA_Item:OnUnequip(): nil
Found 1 function for onequip
🇸 CDOTA_Item:OnEquip(): nil
oh I forgot about that yeah
do I have to set it back manually to normal value though?
or do I just call onequip after modifier wears off?
unequip and onequip whenever you want the values to be run through GetModifierOverrideAbilitySpecial
or when you want your modified value to be reset
Thanks
Where do I call onunequip and onequip to make this work though
i'm applying the modifier to attacker onattacklanded to modify crit value
oncreated doesnt work for first hit
crits are determined before the attack is launched, so you would have to modify it before the attack
damn
that's not gonna work for this
i want to recreate this item in dota
that's the problematic part
you may be able to do that from something like ontakedamage or similar functions. let me take a look
actually nvm, you wouldnt be able to do it accurately since there are some items that add damage directly to your attack (not as a separate instance of damage)
if you rewrote every crit you could make it work :)
Wanted to give the attacker a modifier for 0.01 sec that would replace crit multiplier on all items by -30% but ig thats not gonna work
is this passive, or a temporary active
passive
you could have the modifier active all the time, and only reduce when the target owns that item
oh
but. im not sure if that would work, due to onunequip onequip probably not being instant
probably takes 1 frame
Big brain moment
🙇
In case of abilities (like PA's ulti) how do I update them?
depends on the ability.
for pa crit, most likely you'd need to refresh the abilities intrinsic modifier.
usually for an active ability it will call GetSpecialValueFor every cast, in which case you would have nothing to "update". it would call it on its own.
for abilities that apply modifiers, most of them will have have OnRefresh functions set up to re-get the special values (for instances like leveling up the ability).
and im sure there are some cases that dont store the value and re-get it every single time its needed.
I remember about a discussion to detect critical strike somewhere
maybe you can use that, and when it procs, give the crit unit a 30% outgoing damage reduction
That would affect proc's other than crits too i think.
Also that crit detection method supposedly has an issue where all fake attacks are considered crits.
what kind of things would also procs other than actual crits and the fake attack issue?
as for fake attack, in this use case you can just filter attacks with >0 damage, then do the reduction
this was already discussed in a post about the crit detection.
you cant filter by damage because the crit is determined before the damage is determined.
crits are pre-damage => damage is always 0
and by other procs, i mean you could for example have something like javelin.
if you reduced the incoming damage when a crit is detected, and javelin also proc'd on that attack the javelin damage would be reduced too
heres another potential big brain idea
target_criticalstrike might override the crit
replace the crit entirely by a different, smaller crit
is that like bloodthorn? i thought that stacked with crit damage.
or what item am i thinking of, where the target takes bonus damage from damage
no, you reduce it after the attack lands
when the attack lands, OutGoingDamage event procs, and that's where you filter by attack record, and reduce it if the attack source comes from crit and have >0 damage.
does Javelin uses normal crit procs though?
I thought it is a separate RNG instance that deals bonus magic damage if procs
yes, but it is not a crit
because crit is when the red number appeared in doto
but you dont know when its a crit
or what part of the damage is from other items like javelin
I thought the crit detection relies on the check if Crit Damage rolls in.
So you can know if an attack is gonna crit or not based from that, and get the attack record from it
from that attack record, you filter it after it lands
as for fake attack, in this use case you can just filter attacks with >0 damage
you cant filter out fake attacks to determine the crit, because you cant know about the damage until the attack occurs. and the crit is determined before the damage is available.
the problem is your solution filters all damage, not just the critical damage
javelin pierce, feast and similar damage is added to the damage
post-crit
- OnAttackStart
- Check if the attack crit based on OnCritDamage and/or GetPreAttackCriticalStrike
- Store the attack_record number
- OnAttack
- OnAttackLanded
- ModifierOutgoingDamage
- check if
attack_recordis in the stored table anddamage>0 - if they pass, return -30
crit occurs, you register the attack record => javelin also procs dealing 80 flat damage
damage post crit is lets say 200, javelin adds 80 for 280 total; if we use outgoingdamage then you're reducing 280 to 196 instead of 220 with 30% crit reduction
its all one instance of attack damage
and if its a fake attack the crit detection modifier will say its a crit regardless of if it really is or not, resulting in all fake attacks also having reduced damage
well thel atter isn't an issue with elfansoer's solution
and if the former is acceptable behavior its an ok solution
its probably a 'good enough' solution tbh
GetPreAttackCriticalStrike never gets called on fake attacks
well, the reduced damage is literally 0 damage
for other procced instance of damage, separate different OutGoingDamage event will occur later
again the problem is these procs aren't separate instances
except they arent all separate instances.
procattack is part of the attack damage calc
does Crit damage included in original_damage key in ProcAttackFeedback/Magical/Physical?

