Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] hello everyone, i have this simple script

[DiscordArchive] hello everyone, i have this simple script

[DiscordArchive] hello everyone, i have this simple script

rektbyfaith
Administrator
0
05-01-2024, 05:51 PM
#1
Archived author: kabi • Posted: 2024-05-01T17:51:42.096000+00:00
Original source

hello everyone, i have this simple script

```lua
local function PlayerKillsMonster(event, player)
print("Creature killed.")
end
RegisterPlayerEvent(7, PlayerKillsMonster)
```

let's say i only want it to print to console if a player kills a rare. isElite does only return true or false, not what type the monster is (rare, rare elite, elite). and the following flags

```lua
creature:GetUnitFlags()
creature:GetUnitFlagsTwo()
creature:GetNPCFlags()
creature:GetExtraFlags()
```

do not return "rank" in creature_template.

should i use an if-else statement with all IDs of rare creatures and check in the lua script or fetch rare creatures via SQL and check against the result?
rektbyfaith
05-01-2024, 05:51 PM #1

Archived author: kabi • Posted: 2024-05-01T17:51:42.096000+00:00
Original source

hello everyone, i have this simple script

```lua
local function PlayerKillsMonster(event, player)
print("Creature killed.")
end
RegisterPlayerEvent(7, PlayerKillsMonster)
```

let's say i only want it to print to console if a player kills a rare. isElite does only return true or false, not what type the monster is (rare, rare elite, elite). and the following flags

```lua
creature:GetUnitFlags()
creature:GetUnitFlagsTwo()
creature:GetNPCFlags()
creature:GetExtraFlags()
```

do not return "rank" in creature_template.

should i use an if-else statement with all IDs of rare creatures and check in the lua script or fetch rare creatures via SQL and check against the result?

rektbyfaith
Administrator
0
05-01-2024, 05:56 PM
#2
Archived author: Honey • Posted: 2024-05-01T17:56:31.328000+00:00
Original source

If there's no API for it, you can SELECT all creature entries that are rares from the database, add them to a table and look up of the creature entry is on that list. It seems like a rather costly approach to do that for every killed creature.
rektbyfaith
05-01-2024, 05:56 PM #2

Archived author: Honey • Posted: 2024-05-01T17:56:31.328000+00:00
Original source

If there's no API for it, you can SELECT all creature entries that are rares from the database, add them to a table and look up of the creature entry is on that list. It seems like a rather costly approach to do that for every killed creature.

rektbyfaith
Administrator
0
05-01-2024, 06:02 PM
#3
Archived author: Foe • Posted: 2024-05-01T18:02:23.849000+00:00
Original source

Pretty sure it's available in the uint32values
rektbyfaith
05-01-2024, 06:02 PM #3

Archived author: Foe • Posted: 2024-05-01T18:02:23.849000+00:00
Original source

Pretty sure it's available in the uint32values

rektbyfaith
Administrator
0
05-01-2024, 06:02 PM
#4
Archived author: kabi • Posted: 2024-05-01T18:02:28.663000+00:00
Original source

a table in a separate database or inside the lua script itself? but basically saving the 200 entries somewhere without going over everything everytime
rektbyfaith
05-01-2024, 06:02 PM #4

Archived author: kabi • Posted: 2024-05-01T18:02:28.663000+00:00
Original source

a table in a separate database or inside the lua script itself? but basically saving the 200 entries somewhere without going over everything everytime

rektbyfaith
Administrator
0
05-01-2024, 06:04 PM
#5
Archived author: Foe • Posted: 2024-05-01T18:04:12.752000+00:00
Original source

which rank are you looking for specifically
rektbyfaith
05-01-2024, 06:04 PM #5

Archived author: Foe • Posted: 2024-05-01T18:04:12.752000+00:00
Original source

which rank are you looking for specifically

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