⚔️ fight_GetChallengeProperty(challenge, property)
Récupère une propriété spécifique d'un challenge (challengeId, name, xpBonus, dropBonus, state, etc.).
fight_GetChallengeProperty(challenge, property)
FightRécupère une propriété spécifique d'un challenge (challengeId, name, xpBonus, dropBonus, state, etc.).
Paramètres
| Paramètre | Type | Description |
|---|---|---|
challenge |
table | Le challenge (obtenu via fight_GetChallenges ou fight_GetChallengeFromList) |
property |
string | Le nom de la propriété (ex: 'challengeId', 'name', 'xpBonus', 'dropBonus', 'state') |
Valeur de retour
object - La valeur de la propriété (nil si non trouvée)
Exemple
function example_fightgetchallengeproperty()
-- Obtenir les propriétés d'un challenge
local challenges = fight_GetChallenges()
for challengeId, challenge in pairs(challenges) do
local name = fight_GetChallengeProperty(challenge, "name")
local xpBonus = fight_GetChallengeProperty(challenge, "xpBonus")
local dropBonus = fight_GetChallengeProperty(challenge, "dropBonus")
fight_SendLogs("Challenge: " .. name .. " (+" .. xpBonus .. "% XP, +" .. dropBonus .. "% Drop)", "Cyan")
end
end
-- Appeler la fonction
example_fightgetchallengeproperty()