Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] wait shouldnt it be against owner not victim ?

[DiscordArchive] wait shouldnt it be against owner not victim ?

[DiscordArchive] wait shouldnt it be against owner not victim ?

rektbyfaith
Administrator
0
12-22-2022, 12:13 AM
#1
Archived author: Rymercyble • Posted: 2022-12-22T00:13:52.498000+00:00
Original source

wait shouldnt it be against owner not victim ?
rektbyfaith
12-22-2022, 12:13 AM #1

Archived author: Rymercyble • Posted: 2022-12-22T00:13:52.498000+00:00
Original source

wait shouldnt it be against owner not victim ?

rektbyfaith
Administrator
0
12-22-2022, 12:13 AM
#2
Archived author: Rymercyble • Posted: 2022-12-22T00:13:58.699000+00:00
Original source

since victim is player
rektbyfaith
12-22-2022, 12:13 AM #2

Archived author: Rymercyble • Posted: 2022-12-22T00:13:58.699000+00:00
Original source

since victim is player

rektbyfaith
Administrator
0
12-22-2022, 12:14 AM
#3
Archived author: Anchy • Posted: 2022-12-22T00:14:22.596000+00:00
Original source

idk i was just copying your code
rektbyfaith
12-22-2022, 12:14 AM #3

Archived author: Anchy • Posted: 2022-12-22T00:14:22.596000+00:00
Original source

idk i was just copying your code

rektbyfaith
Administrator
0
12-22-2022, 12:14 AM
#4
Archived author: Rymercyble • Posted: 2022-12-22T00:14:33.562000+00:00
Original source

rektbyfaith
12-22-2022, 12:14 AM #4

Archived author: Rymercyble • Posted: 2022-12-22T00:14:33.562000+00:00
Original source

rektbyfaith
Administrator
0
12-22-2022, 12:15 AM
#5
Archived author: Rymercyble • Posted: 2022-12-22T00:15:24.269000+00:00
Original source

now its 1 when i attack with second char
rektbyfaith
12-22-2022, 12:15 AM #5

Archived author: Rymercyble • Posted: 2022-12-22T00:15:24.269000+00:00
Original source

now its 1 when i attack with second char

rektbyfaith
Administrator
0
12-22-2022, 12:15 AM
#6
Archived author: Rymercyble • Posted: 2022-12-22T00:15:44.003000+00:00
Original source

that would make sense since i placed hook before not after
rektbyfaith
12-22-2022, 12:15 AM #6

Archived author: Rymercyble • Posted: 2022-12-22T00:15:44.003000+00:00
Original source

that would make sense since i placed hook before not after

rektbyfaith
Administrator
0
12-22-2022, 12:17 AM
#7
Archived author: Rymercyble • Posted: 2022-12-22T00:17:50.593000+00:00
Original source

i moved it to be after so i dont have to add 1 and it works but as we speak earlier now i have to confirm if it counts everything or only players
rektbyfaith
12-22-2022, 12:17 AM #7

Archived author: Rymercyble • Posted: 2022-12-22T00:17:50.593000+00:00
Original source

i moved it to be after so i dont have to add 1 and it works but as we speak earlier now i have to confirm if it counts everything or only players

rektbyfaith
Administrator
0
12-22-2022, 12:37 AM
#8
Archived author: Rymercyble • Posted: 2022-12-22T00:37:56.636000+00:00
Original source

so i confirmed it counts not only players so to count only players i did this
```cpp
int count = 0;

auto threat_list = hostileRef->GetOwner()->GetThreatMgr().GetThreatList();

for (const auto ref: threat_list) {
if (!ref->GetVictim()) {
continue;
}

if (ref->GetVictim()->IsPlayer()) {
count++;
}
}
```
last issue to be solved is that this way it decreases when player dies
rektbyfaith
12-22-2022, 12:37 AM #8

Archived author: Rymercyble • Posted: 2022-12-22T00:37:56.636000+00:00
Original source

so i confirmed it counts not only players so to count only players i did this
```cpp
int count = 0;

auto threat_list = hostileRef->GetOwner()->GetThreatMgr().GetThreatList();

for (const auto ref: threat_list) {
if (!ref->GetVictim()) {
continue;
}

if (ref->GetVictim()->IsPlayer()) {
count++;
}
}
```
last issue to be solved is that this way it decreases when player dies

Recently Browsing
 
Recently Browsing