Forums WoW Modding Support Archives WoWModding Threads [DiscordArchive] Hi there anyone know how to prevent NPC spawnin...

[DiscordArchive] Hi there anyone know how to prevent NPC spawnin...

[DiscordArchive] Hi there anyone know how to prevent NPC spawnin...

Pages (2): 1 2 Next
rektbyfaith
Administrator
0
09-09-2025, 03:02 PM
#1
Archived author: Needle • Posted: 2025-09-09T15:02:21.560000+00:00
Original source

rektbyfaith
09-09-2025, 03:02 PM #1

Archived author: Needle • Posted: 2025-09-09T15:02:21.560000+00:00
Original source

rektbyfaith
Administrator
0
09-09-2025, 03:02 PM
#2
Archived author: Needle • Posted: 2025-09-09T15:02:22.239000+00:00
Original source

Thread automatically created by dr3amforg3 in <#415944535718494208>
rektbyfaith
09-09-2025, 03:02 PM #2

Archived author: Needle • Posted: 2025-09-09T15:02:22.239000+00:00
Original source

Thread automatically created by dr3amforg3 in <#415944535718494208>

rektbyfaith
Administrator
0
09-09-2025, 03:57 PM
#3
Archived author: Hex • Posted: 2025-09-09T15:57:02.633000+00:00
Original source

By default, player:SpawnCreature(entry, x, y, z, o, spawnType, despawnTime) will happily spawn inside geometry if you feed it raw player coordinates. To avoid that, you can
rektbyfaith
09-09-2025, 03:57 PM #3

Archived author: Hex • Posted: 2025-09-09T15:57:02.633000+00:00
Original source

By default, player:SpawnCreature(entry, x, y, z, o, spawnType, despawnTime) will happily spawn inside geometry if you feed it raw player coordinates. To avoid that, you can

rektbyfaith
Administrator
0
09-09-2025, 03:57 PM
#4
Archived author: Hex • Posted: 2025-09-09T15:57:49.374000+00:00
Original source

```
local x, y, z, o = player:GetLocation()
local dist = 2 -- how far in front of player
local nx = x + math.cos(o) * dist
local ny = y + math.sin(o) * dist
local nz = player:GetMap():GetHeight(nx, ny, z) -- adjust height to ground
player:SpawnCreature(12345, nx, ny, nz, o, 3, 60000)
```
rektbyfaith
09-09-2025, 03:57 PM #4

Archived author: Hex • Posted: 2025-09-09T15:57:49.374000+00:00
Original source

```
local x, y, z, o = player:GetLocation()
local dist = 2 -- how far in front of player
local nx = x + math.cos(o) * dist
local ny = y + math.sin(o) * dist
local nz = player:GetMap():GetHeight(nx, ny, z) -- adjust height to ground
player:SpawnCreature(12345, nx, ny, nz, o, 3, 60000)
```

rektbyfaith
Administrator
0
09-09-2025, 03:58 PM
#5
Archived author: Hex • Posted: 2025-09-09T15:58:11.200000+00:00
Original source

Offset the spawn point a little in front of the player
rektbyfaith
09-09-2025, 03:58 PM #5

Archived author: Hex • Posted: 2025-09-09T15:58:11.200000+00:00
Original source

Offset the spawn point a little in front of the player

rektbyfaith
Administrator
0
09-09-2025, 03:58 PM
#6
Archived author: Hex • Posted: 2025-09-09T15:58:38.708000+00:00
Original source

or you can just check the line of sight before spawning it
rektbyfaith
09-09-2025, 03:58 PM #6

Archived author: Hex • Posted: 2025-09-09T15:58:38.708000+00:00
Original source

or you can just check the line of sight before spawning it

rektbyfaith
Administrator
0
09-09-2025, 03:58 PM
#7
Archived author: Hex • Posted: 2025-09-09T15:58:45.767000+00:00
Original source

something like that
rektbyfaith
09-09-2025, 03:58 PM #7

Archived author: Hex • Posted: 2025-09-09T15:58:45.767000+00:00
Original source

something like that

rektbyfaith
Administrator
0
09-09-2025, 03:58 PM
#8
Archived author: Hex • Posted: 2025-09-09T15:58:58.285000+00:00
Original source

```
if player:IsWithinLoS(nx, ny, nz) then
player:SpawnCreature(12345, nx, ny, nz, o, 3, 60000)
else
player:SendBroadcastMessage("Can't spawn here, too close to wall!")
end
```
rektbyfaith
09-09-2025, 03:58 PM #8

Archived author: Hex • Posted: 2025-09-09T15:58:58.285000+00:00
Original source

```
if player:IsWithinLoS(nx, ny, nz) then
player:SpawnCreature(12345, nx, ny, nz, o, 3, 60000)
else
player:SendBroadcastMessage("Can't spawn here, too close to wall!")
end
```

rektbyfaith
Administrator
0
09-09-2025, 03:59 PM
#9
Archived author: Hex • Posted: 2025-09-09T15:59:30.172000+00:00
Original source

disocrd disorder the code but you can copy paste it somewhere else and see it cleanly
rektbyfaith
09-09-2025, 03:59 PM #9

Archived author: Hex • Posted: 2025-09-09T15:59:30.172000+00:00
Original source

disocrd disorder the code but you can copy paste it somewhere else and see it cleanly

rektbyfaith
Administrator
0
09-09-2025, 07:47 PM
#10
Archived author: dr3amforg3 • Posted: 2025-09-09T19:47:39.652000+00:00
Original source

Thanks Man
rektbyfaith
09-09-2025, 07:47 PM #10

Archived author: dr3amforg3 • Posted: 2025-09-09T19:47:39.652000+00:00
Original source

Thanks Man

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