Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] well what is the purpose of this?

[DiscordArchive] well what is the purpose of this?

[DiscordArchive] well what is the purpose of this?

Pages (6): Previous 1 2 3 4 5 6 Next
rektbyfaith
Administrator
0
12-21-2022, 08:38 PM
#21
Archived author: Anchy • Posted: 2022-12-21T20:38:23.747000+00:00
Original source

right
rektbyfaith
12-21-2022, 08:38 PM #21

Archived author: Anchy • Posted: 2022-12-21T20:38:23.747000+00:00
Original source

right

rektbyfaith
Administrator
0
12-21-2022, 08:38 PM
#22
Archived author: Anchy • Posted: 2022-12-21T20:38:36.409000+00:00
Original source

so something like this
rektbyfaith
12-21-2022, 08:38 PM #22

Archived author: Anchy • Posted: 2022-12-21T20:38:36.409000+00:00
Original source

so something like this

rektbyfaith
Administrator
0
12-21-2022, 08:44 PM
#23
Archived author: Anchy • Posted: 2022-12-21T20:44:16.601000+00:00
Original source

```cpp
void CreatureScript::OnUnitEnterCombat(Unit* unit, Unit* victim)
{
if(victim->IsPlayer() &&
!unit->IsPlayer())
return;

Player* player = unit->ToPlayer();
if(IsInCombat(player)) //Check if exist in combat cache
return;

combatCache.insert(player->GetGUID());
}

void CreatureScript::OnUnitEnterEvadeMode(Unit* unit, uint8 why)
{
combatCache.clear();
}
```
rektbyfaith
12-21-2022, 08:44 PM #23

Archived author: Anchy • Posted: 2022-12-21T20:44:16.601000+00:00
Original source

```cpp
void CreatureScript::OnUnitEnterCombat(Unit* unit, Unit* victim)
{
if(victim->IsPlayer() &&
!unit->IsPlayer())
return;

Player* player = unit->ToPlayer();
if(IsInCombat(player)) //Check if exist in combat cache
return;

combatCache.insert(player->GetGUID());
}

void CreatureScript::OnUnitEnterEvadeMode(Unit* unit, uint8 why)
{
combatCache.clear();
}
```

rektbyfaith
Administrator
0
12-21-2022, 08:44 PM
#24
Archived author: Anchy • Posted: 2022-12-21T20:44:33.835000+00:00
Original source

you will probably have to create a new combatCache for every npc that has been attacked by a player
rektbyfaith
12-21-2022, 08:44 PM #24

Archived author: Anchy • Posted: 2022-12-21T20:44:33.835000+00:00
Original source

you will probably have to create a new combatCache for every npc that has been attacked by a player

rektbyfaith
Administrator
0
12-21-2022, 08:44 PM
#25
Archived author: Anchy • Posted: 2022-12-21T20:44:40.781000+00:00
Original source

as that is more of a global cache and will definitely have problems
rektbyfaith
12-21-2022, 08:44 PM #25

Archived author: Anchy • Posted: 2022-12-21T20:44:40.781000+00:00
Original source

as that is more of a global cache and will definitely have problems

rektbyfaith
Administrator
0
12-21-2022, 08:44 PM
#26
Archived author: Anchy • Posted: 2022-12-21T20:44:50.235000+00:00
Original source

then you can scale based on combatCache size
rektbyfaith
12-21-2022, 08:44 PM #26

Archived author: Anchy • Posted: 2022-12-21T20:44:50.235000+00:00
Original source

then you can scale based on combatCache size

rektbyfaith
Administrator
0
12-21-2022, 08:45 PM
#27
Archived author: Anchy • Posted: 2022-12-21T20:45:09.152000+00:00
Original source

then delete it after it either evades or dies
rektbyfaith
12-21-2022, 08:45 PM #27

Archived author: Anchy • Posted: 2022-12-21T20:45:09.152000+00:00
Original source

then delete it after it either evades or dies

rektbyfaith
Administrator
0
12-21-2022, 08:45 PM
#28
Archived author: Rymercyble • Posted: 2022-12-21T20:45:58.974000+00:00
Original source

let me try that....i was experimenting few lines above in `Unit::CombatStart` with
```cpp
if (!victim->IsPlayer()) {
std:Confusedtring test_message =
"combat started between " + victim->ToCreature()->GetGUID().ToString() + " and " +
this->ToPlayer()->GetGUID().ToString();

sWorld->SendServerMessage(SERVER_MSG_STRING, test_message);
}
```
but i was not able to solve its issues
rektbyfaith
12-21-2022, 08:45 PM #28

Archived author: Rymercyble • Posted: 2022-12-21T20:45:58.974000+00:00
Original source

let me try that....i was experimenting few lines above in `Unit::CombatStart` with
```cpp
if (!victim->IsPlayer()) {
std:Confusedtring test_message =
"combat started between " + victim->ToCreature()->GetGUID().ToString() + " and " +
this->ToPlayer()->GetGUID().ToString();

sWorld->SendServerMessage(SERVER_MSG_STRING, test_message);
}
```
but i was not able to solve its issues

rektbyfaith
Administrator
0
12-21-2022, 08:46 PM
#29
Archived author: Anchy • Posted: 2022-12-21T20:46:26.045000+00:00
Original source

you can use Acore::FormatFmt if you want cleaner formats by the way
rektbyfaith
12-21-2022, 08:46 PM #29

Archived author: Anchy • Posted: 2022-12-21T20:46:26.045000+00:00
Original source

you can use Acore::FormatFmt if you want cleaner formats by the way

rektbyfaith
Administrator
0
12-21-2022, 08:47 PM
#30
Archived author: Anchy • Posted: 2022-12-21T20:47:03.363000+00:00
Original source

```cpp
Acore::FormatFmt("Combat started between {} and {}", victim->ToCreature()->GetGUID, etc..);
```
rektbyfaith
12-21-2022, 08:47 PM #30

Archived author: Anchy • Posted: 2022-12-21T20:47:03.363000+00:00
Original source

```cpp
Acore::FormatFmt("Combat started between {} and {}", victim->ToCreature()->GetGUID, etc..);
```

Pages (6): Previous 1 2 3 4 5 6 Next
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)