Forums WoW Modding Support Archives WoWModding Support Archives [DiscordArchive] Anyone knows a way to call all players who attacked the creature in cpp ?

[DiscordArchive] Anyone knows a way to call all players who attacked the creature in cpp ?

[DiscordArchive] Anyone knows a way to call all players who attacked the creature in cpp ?

rektbyfaith
Administrator
0
01-31-2024, 07:39 AM
#1
Archived author: VaZ3D • Posted: 2024-01-31T07:39:50.357000+00:00
Original source

Anyone knows a way to call all players who attacked the creature in cpp ?
rektbyfaith
01-31-2024, 07:39 AM #1

Archived author: VaZ3D • Posted: 2024-01-31T07:39:50.357000+00:00
Original source

Anyone knows a way to call all players who attacked the creature in cpp ?

rektbyfaith
Administrator
0
01-31-2024, 07:42 AM
#2
Archived author: robinsch • Posted: 2024-01-31T07:42:20.011000+00:00
Original source

iterate threat list
rektbyfaith
01-31-2024, 07:42 AM #2

Archived author: robinsch • Posted: 2024-01-31T07:42:20.011000+00:00
Original source

iterate threat list

rektbyfaith
Administrator
0
01-31-2024, 07:43 AM
#3
Archived author: VaZ3D • Posted: 2024-01-31T07:43:14.518000+00:00
Original source

```int32 creatureEntry = creature->GetEntry(); // Obtain the creature entry
ThreatContainer::StorageType threatList = creature->GetThreatMgr().GetThreatList(); // Obtain the threat list

for (ThreatContainer::StorageType::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)```
like this ?
rektbyfaith
01-31-2024, 07:43 AM #3

Archived author: VaZ3D • Posted: 2024-01-31T07:43:14.518000+00:00
Original source

```int32 creatureEntry = creature->GetEntry(); // Obtain the creature entry
ThreatContainer::StorageType threatList = creature->GetThreatMgr().GetThreatList(); // Obtain the threat list

for (ThreatContainer::StorageType::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)```
like this ?

rektbyfaith
Administrator
0
01-31-2024, 07:43 AM
#4
Archived author: robinsch • Posted: 2024-01-31T07:43:40.428000+00:00
Original source

Don't know, you should find a ton of examples that do this.
rektbyfaith
01-31-2024, 07:43 AM #4

Archived author: robinsch • Posted: 2024-01-31T07:43:40.428000+00:00
Original source

Don't know, you should find a ton of examples that do this.

rektbyfaith
Administrator
0
01-31-2024, 07:44 AM
#5
Archived author: VaZ3D • Posted: 2024-01-31T07:44:28.098000+00:00
Original source

already tried everything with threatlist.
if it comes to this part
```for (ThreatContainer::StorageType::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)```
i only get a empty threatlists
rektbyfaith
01-31-2024, 07:44 AM #5

Archived author: VaZ3D • Posted: 2024-01-31T07:44:28.098000+00:00
Original source

already tried everything with threatlist.
if it comes to this part
```for (ThreatContainer::StorageType::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)```
i only get a empty threatlists

rektbyfaith
Administrator
0
01-31-2024, 07:44 AM
#6
Archived author: robinsch • Posted: 2024-01-31T07:44:30.893000+00:00
Original source

There have been a ton of rewrites for threat management the past 15 years so I have no clue what the current TC syntax is.
rektbyfaith
01-31-2024, 07:44 AM #6

Archived author: robinsch • Posted: 2024-01-31T07:44:30.893000+00:00
Original source

There have been a ton of rewrites for threat management the past 15 years so I have no clue what the current TC syntax is.

rektbyfaith
Administrator
0
01-31-2024, 07:46 AM
#7
Archived author: robinsch • Posted: 2024-01-31T07:46:08.064000+00:00
Original source

`.debug threat` should give you some info.
rektbyfaith
01-31-2024, 07:46 AM #7

Archived author: robinsch • Posted: 2024-01-31T07:46:08.064000+00:00
Original source

`.debug threat` should give you some info.

rektbyfaith
Administrator
0
01-31-2024, 07:47 AM
#8
Archived author: robinsch • Posted: 2024-01-31T07:47:37.163000+00:00
Original source

I think this is the correct way in current TC to loop it:
```cpp
for (ThreatReference const* ref : create->GetThreatManager().GetUnsortedThreatList())
```
```
Unit* unit = ref->GetVictim()
```
rektbyfaith
01-31-2024, 07:47 AM #8

Archived author: robinsch • Posted: 2024-01-31T07:47:37.163000+00:00
Original source

I think this is the correct way in current TC to loop it:
```cpp
for (ThreatReference const* ref : create->GetThreatManager().GetUnsortedThreatList())
```
```
Unit* unit = ref->GetVictim()
```

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)