[DiscordArchive] hello everyone, i have this simple script
[DiscordArchive] hello everyone, i have this simple script
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?
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.
Archived author: Foe • Posted: 2024-05-01T18:02:23.849000+00:00
Original source
Pretty sure it's available in the uint32values
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
Archived author: Foe • Posted: 2024-05-01T18:04:12.752000+00:00
Original source
which rank are you looking for specifically