Introduces the GetRank method. Rank is used in creature_template to set the rank of the creature, e.g. rare (4) or rare elite (2).
You can test this in game with this lua script:
local command = "#rank"
local function FetchCreatureRank(event, player, message, type, language)
if message == command then
local creature = player:GetSelection() -- Get the player's target
if creature then
local rank = creature:GetRank() -- Fetch the rank of the selected creature
if rank then
print("Creature Rank: " .. rank) -- Print the creature's rank
else
print("Creature rank not available.")
end
else
print("No creature selected.")
end
return false -- Prevent the default chat behavior
end
end
RegisterPlayerEvent(18, FetchCreatureRank)
If the player types "#rank" while having targeted a creature, the script will print the creature's rank to the console.
Introduces the GetRank method. Rank is used in creature_template to set the rank of the creature, e.g. rare (4) or rare elite (2).
You can test this in game with this lua script:
If the player types "#rank" while having targeted a creature, the script will print the creature's rank to the console.