Forums WoW Modding Support Archives TrinityCore Discord Archives [DiscordArchive] You were searching for a way to handle Map leaving, right?

[DiscordArchive] You were searching for a way to handle Map leaving, right?

[DiscordArchive] You were searching for a way to handle Map leaving, right?

Pages (6): Previous 1 2 3 4 5 6 Next
rektbyfaith
Administrator
0
06-25-2019, 02:23 PM
#11
Archived author: Hido • Posted: 2019-06-25T14:23:43.783000+00:00
Original source

I just want to set the phase of the player to 1 when he leave a map
rektbyfaith
06-25-2019, 02:23 PM #11

Archived author: Hido • Posted: 2019-06-25T14:23:43.783000+00:00
Original source

I just want to set the phase of the player to 1 when he leave a map

rektbyfaith
Administrator
0
06-25-2019, 02:25 PM
#12
Archived author: MR.MUSTACHE • Posted: 2019-06-25T14:25:53.467000+00:00
Original source

Every map?
rektbyfaith
06-25-2019, 02:25 PM #12

Archived author: MR.MUSTACHE • Posted: 2019-06-25T14:25:53.467000+00:00
Original source

Every map?

rektbyfaith
Administrator
0
06-25-2019, 02:28 PM
#13
Archived author: MR.MUSTACHE • Posted: 2019-06-25T14:28:02.377000+00:00
Original source

<@559407472759275540>
1. find the file
``` src\server\game\Maps\Map.cpp ```
2. Find the function ``` void Map::RemovePlayerFromMap(Player* player, bool remove) ```
3. Bellow
```
if (remove)
DeleteFromWorld(player);
```
add
```
if (player)
player->SetPhaseMask(PHASEMASK_NORMAL, true);
```
rektbyfaith
06-25-2019, 02:28 PM #13

Archived author: MR.MUSTACHE • Posted: 2019-06-25T14:28:02.377000+00:00
Original source

<@559407472759275540>
1. find the file
``` src\server\game\Maps\Map.cpp ```
2. Find the function ``` void Map::RemovePlayerFromMap(Player* player, bool remove) ```
3. Bellow
```
if (remove)
DeleteFromWorld(player);
```
add
```
if (player)
player->SetPhaseMask(PHASEMASK_NORMAL, true);
```

rektbyfaith
Administrator
0
06-25-2019, 02:28 PM
#14
Archived author: Hido • Posted: 2019-06-25T14:28:30.062000+00:00
Original source

Nop only the map 571
rektbyfaith
06-25-2019, 02:28 PM #14

Archived author: Hido • Posted: 2019-06-25T14:28:30.062000+00:00
Original source

Nop only the map 571

rektbyfaith
Administrator
0
06-25-2019, 02:28 PM
#15
Archived author: MR.MUSTACHE • Posted: 2019-06-25T14:28:35.200000+00:00
Original source

ok sec
rektbyfaith
06-25-2019, 02:28 PM #15

Archived author: MR.MUSTACHE • Posted: 2019-06-25T14:28:35.200000+00:00
Original source

ok sec

rektbyfaith
Administrator
0
06-25-2019, 02:28 PM
#16
Archived author: Hido • Posted: 2019-06-25T14:28:38.536000+00:00
Original source

The best would be only the Area 4254
rektbyfaith
06-25-2019, 02:28 PM #16

Archived author: Hido • Posted: 2019-06-25T14:28:38.536000+00:00
Original source

The best would be only the Area 4254

rektbyfaith
Administrator
0
06-25-2019, 02:28 PM
#17
Archived author: Hido • Posted: 2019-06-25T14:28:41.948000+00:00
Original source

But the map it's great
rektbyfaith
06-25-2019, 02:28 PM #17

Archived author: Hido • Posted: 2019-06-25T14:28:41.948000+00:00
Original source

But the map it's great

rektbyfaith
Administrator
0
06-25-2019, 02:32 PM
#18
Archived author: MR.MUSTACHE • Posted: 2019-06-25T14:32:46.009000+00:00
Original source

hmm then you need to check the area before the player is removed from the old map and apply the phase after he is moved to the new map
rektbyfaith
06-25-2019, 02:32 PM #18

Archived author: MR.MUSTACHE • Posted: 2019-06-25T14:32:46.009000+00:00
Original source

hmm then you need to check the area before the player is removed from the old map and apply the phase after he is moved to the new map

rektbyfaith
Administrator
0
06-25-2019, 02:32 PM
#19
Archived author: MR.MUSTACHE • Posted: 2019-06-25T14:32:55.105000+00:00
Original source

probably gonna need a boolean here
rektbyfaith
06-25-2019, 02:32 PM #19

Archived author: MR.MUSTACHE • Posted: 2019-06-25T14:32:55.105000+00:00
Original source

probably gonna need a boolean here

rektbyfaith
Administrator
0
06-25-2019, 02:35 PM
#20
Archived author: MR.MUSTACHE • Posted: 2019-06-25T14:35:01.686000+00:00
Original source

```cpp
void Map::RemovePlayerFromMap(Player* player, bool remove)
{
// Before leaving map, update zone/area for stats
player->UpdateZone(MAP_INVALID_ZONE, 0);
sScriptMgr->OnPlayerLeaveMap(this, player);

player->CombatStop();
//verify that the player is leaving the area 4254
bool const Normalize = player->GetAreaId() == 4254;

bool const inWorld = player->IsInWorld();
player->RemoveFromWorld();
SendRemoveTransports(player);

if (!inWorld) // if was in world, RemoveFromWorld() called DestroyForNearbyPlayers()
player->DestroyForNearbyPlayers(); // previous player->UpdateObjectVisibility(true)

if (player->IsInGrid())
player->RemoveFromGrid();
else
ASSERT(remove); //maybe deleted in logoutplayer when player is not in a map

if (remove)
DeleteFromWorld(player);

//normalize phase if player is leaving the area 4254
if (player && Normalize)
player->SetPhaseMask(PHASEMASK_NORMAL, true);
}
```
rektbyfaith
06-25-2019, 02:35 PM #20

Archived author: MR.MUSTACHE • Posted: 2019-06-25T14:35:01.686000+00:00
Original source

```cpp
void Map::RemovePlayerFromMap(Player* player, bool remove)
{
// Before leaving map, update zone/area for stats
player->UpdateZone(MAP_INVALID_ZONE, 0);
sScriptMgr->OnPlayerLeaveMap(this, player);

player->CombatStop();
//verify that the player is leaving the area 4254
bool const Normalize = player->GetAreaId() == 4254;

bool const inWorld = player->IsInWorld();
player->RemoveFromWorld();
SendRemoveTransports(player);

if (!inWorld) // if was in world, RemoveFromWorld() called DestroyForNearbyPlayers()
player->DestroyForNearbyPlayers(); // previous player->UpdateObjectVisibility(true)

if (player->IsInGrid())
player->RemoveFromGrid();
else
ASSERT(remove); //maybe deleted in logoutplayer when player is not in a map

if (remove)
DeleteFromWorld(player);

//normalize phase if player is leaving the area 4254
if (player && Normalize)
player->SetPhaseMask(PHASEMASK_NORMAL, true);
}
```

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