Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] Hello everyone, I'm using the CREATURE_EVENT_ON_DAMAGE_TAKEN event to modify the final damage dealt

[DiscordArchive] Hello everyone, I'm using the CREATURE_EVENT_ON_DAMAGE_TAKEN event to modify the final damage dealt

[DiscordArchive] Hello everyone, I'm using the CREATURE_EVENT_ON_DAMAGE_TAKEN event to modify the final damage dealt

Pages (2): 1 2 Next
rektbyfaith
Administrator
0
05-16-2023, 09:17 AM
#1
Archived author: YaHaHa2020 • Posted: 2023-05-16T09:17:21.513000+00:00
Original source

Hello everyone, I'm using the CREATURE_EVENT_ON_DAMAGE_TAKEN event to modify the final damage dealt to monsters, but the client displays the number before the modification. Is there any way to update this number?
rektbyfaith
05-16-2023, 09:17 AM #1

Archived author: YaHaHa2020 • Posted: 2023-05-16T09:17:21.513000+00:00
Original source

Hello everyone, I'm using the CREATURE_EVENT_ON_DAMAGE_TAKEN event to modify the final damage dealt to monsters, but the client displays the number before the modification. Is there any way to update this number?

rektbyfaith
Administrator
0
05-16-2023, 09:17 AM
#2
Archived author: YaHaHa2020 • Posted: 2023-05-16T09:17:42.197000+00:00
Original source

```local CREATURE_EVENT_ON_DAMAGE_TAKEN = 9

local WORLD_EVENT_ON_STARTUP = 14

local function Reset(event, creature, attacker, damage)
local IsPlaer = attacker:GetTypeId()
if IsPlaer ~= nil then
if IsPlaer == 4 then
print(type(attacker),attacker:GetName())
print(damage)
return true,10000
end
end
end


local function registerDamage()
for i = 1 , 40000 do
if WorldDBQuery("SELECT entry FROM creature_template WHERE entry="..i) then
RegisterCreatureEvent(i,CREATURE_EVENT_ON_DAMAGE_TAKEN,Reset)
end
end
end


RegisterServerEvent(WORLD_EVENT_ON_STARTUP,registerDamage)```
rektbyfaith
05-16-2023, 09:17 AM #2

Archived author: YaHaHa2020 • Posted: 2023-05-16T09:17:42.197000+00:00
Original source

```local CREATURE_EVENT_ON_DAMAGE_TAKEN = 9

local WORLD_EVENT_ON_STARTUP = 14

local function Reset(event, creature, attacker, damage)
local IsPlaer = attacker:GetTypeId()
if IsPlaer ~= nil then
if IsPlaer == 4 then
print(type(attacker),attacker:GetName())
print(damage)
return true,10000
end
end
end


local function registerDamage()
for i = 1 , 40000 do
if WorldDBQuery("SELECT entry FROM creature_template WHERE entry="..i) then
RegisterCreatureEvent(i,CREATURE_EVENT_ON_DAMAGE_TAKEN,Reset)
end
end
end


RegisterServerEvent(WORLD_EVENT_ON_STARTUP,registerDamage)```

rektbyfaith
Administrator
0
05-16-2023, 10:40 AM
#3
Archived author: Honey • Posted: 2023-05-16T10:40:37.510000+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.`
rektbyfaith
05-16-2023, 10:40 AM #3

Archived author: Honey • Posted: 2023-05-16T10:40:37.510000+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.`

rektbyfaith
Administrator
0
05-16-2023, 10:40 AM
#4
Archived author: Honey • Posted: 2023-05-16T10:40:52.175000+00:00
Original source

See <https://www.azerothcore.org/pages/eluna/Global/RegisterCreatureEvent.html>
rektbyfaith
05-16-2023, 10:40 AM #4

Archived author: Honey • Posted: 2023-05-16T10:40:52.175000+00:00
Original source

See <https://www.azerothcore.org/pages/eluna/Global/RegisterCreatureEvent.html>

rektbyfaith
Administrator
0
05-16-2023, 10:41 AM
#5
Archived author: Honey • Posted: 2023-05-16T10:41:23.766000+00:00
Original source

Essentially you need to return 2 values, the 2nd being the new value.
rektbyfaith
05-16-2023, 10:41 AM #5

Archived author: Honey • Posted: 2023-05-16T10:41:23.766000+00:00
Original source

Essentially you need to return 2 values, the 2nd being the new value.

rektbyfaith
Administrator
0
05-16-2023, 11:15 AM
#6
Archived author: YaHaHa2020 • Posted: 2023-05-16T11:15:16.960000+00:00
Original source

<@595620700706832414> I used this method to change the damage value, but the number displayed in-game is still the one before it was changed.
The issue here is that while you have successfully modified the actual damage calculation through Eluna, the damage text displayed to players is not updating to reflect this change.
rektbyfaith
05-16-2023, 11:15 AM #6

Archived author: YaHaHa2020 • Posted: 2023-05-16T11:15:16.960000+00:00
Original source

<@595620700706832414> I used this method to change the damage value, but the number displayed in-game is still the one before it was changed.
The issue here is that while you have successfully modified the actual damage calculation through Eluna, the damage text displayed to players is not updating to reflect this change.

rektbyfaith
Administrator
0
05-16-2023, 11:35 AM
#7
Archived author: Clotic • Posted: 2023-05-16T11:35:38.337000+00:00
Original source

Might be possible sending with packet or using AIO to send the data over. Might be simpler just sending a trigger message or something alike it.
rektbyfaith
05-16-2023, 11:35 AM #7

Archived author: Clotic • Posted: 2023-05-16T11:35:38.337000+00:00
Original source

Might be possible sending with packet or using AIO to send the data over. Might be simpler just sending a trigger message or something alike it.

rektbyfaith
Administrator
0
05-16-2023, 12:43 PM
#8
Archived author: Honey • Posted: 2023-05-16T12:43:44.512000+00:00
Original source

Looks like the hook is too late in the core then or doesn't change all neccesary values.
rektbyfaith
05-16-2023, 12:43 PM #8

Archived author: Honey • Posted: 2023-05-16T12:43:44.512000+00:00
Original source

Looks like the hook is too late in the core then or doesn't change all neccesary values.

rektbyfaith
Administrator
0
05-16-2023, 12:44 PM
#9
Archived author: Honey • Posted: 2023-05-16T12:44:05.744000+00:00
Original source

Might be worth an issue, i think it would be nice to have this working out of the box.
rektbyfaith
05-16-2023, 12:44 PM #9

Archived author: Honey • Posted: 2023-05-16T12:44:05.744000+00:00
Original source

Might be worth an issue, i think it would be nice to have this working out of the box.

rektbyfaith
Administrator
0
05-16-2023, 12:57 PM
#10
Archived author: YaHaHa2020 • Posted: 2023-05-16T12:57:22.067000+00:00
Original source

I wish to implement some additional bonus damage against monsters, do you have any suggestions?
rektbyfaith
05-16-2023, 12:57 PM #10

Archived author: YaHaHa2020 • Posted: 2023-05-16T12:57:22.067000+00:00
Original source

I wish to implement some additional bonus damage against monsters, do you have any suggestions?

Pages (2): 1 2 Next
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)