[DiscordArchive] So in this case of creature and target, what class would target be?
[DiscordArchive] So in this case of creature and target, what class would target be?
Archived author: Orion • Posted: 2023-10-16T06:59:31.431000+00:00
Original source
'cause this is the event
```
RegisterCreatureEvent(299, 9, Nathanos_OnDamageTaken)
```
Archived author: Foe • Posted: 2023-10-16T07:01:40.801000+00:00
Original source
Target is a unit
Archived author: Foe • Posted: 2023-10-16T07:01:49.500000+00:00
Original source
It can be both player and creature
Archived author: Orion • Posted: 2023-10-16T07:04:43.882000+00:00
Original source
Ooh, nice. Thanks!
Extending the srv functionality with lua is crazy as fuck, I absolutely love it XD It's like i just found a new toy to play with.
Is there a way to intercept the damage and increase it before it gets dealt to the unit? I did a workaround to deal half of the unit's HP as damage or so, but I'd like to do it the other way too, and I couldnt find anything
Archived author: Roboto • Posted: 2023-10-16T08:27:12.063000+00:00
Original source
`CREATURE_EVENT_ON_DAMAGE_TAKEN = 9, // (event, creature, attacker, damage) - Can return true to stop normal action, can return new damage as second return value.`
Archived author: Roboto • Posted: 2023-10-16T08:27:43.972000+00:00
Original source
> can return new damage as second return value
Archived author: Orion • Posted: 2023-10-16T09:09:42.566000+00:00
Original source
I tried with return {true, newDamage} but it didnt work
Archived author: Orion • Posted: 2023-10-16T09:10:35.219000+00:00
Original source
I'll try it again, maybe the issue was smth else 'cause I do remember changing more than one thing at a time
Archived author: Roboto • Posted: 2023-10-16T09:12:05.923000+00:00
Original source
remove the braces
Archived author: Orion • Posted: 2023-10-16T09:12:06.728000+00:00
Original source
or should I do like return true, newDamage?