FANDOM


local API = {}
 
function getCats(buffs)
    local res = ""
 
    --BUFF ATT
 
    if string.find(buffs, "[^-]atk%-up[^-]") then
        res = res .. "[[Category:ES:Boost ATT]]"
end
    if string.find(buffs, "atk%-up%-fire")
    or string.find(buffs, "atk%-up%-water")
    or string.find(buffs, "atk%-up%-earth")
    or string.find(buffs, "atk%-up%-thunder")
    or string.find(buffs, "atk%-up%-light")
    or string.find(buffs, "atk%-up%-dark") then 
        res = res .. "[[Category:ES:Boost ATT élémentaire]]"
end
    if string.find(buffs, "self%-atk%-up") then
        res = res .. "[[Category:ES:Self Boost ATT]]"
end
    if string.find(buffs, "resist%-atk%-down") then
        res = res .. "[[Category:ES:Immune Réduction ATT]]"
end
    if string.find(buffs, "atk%-down%-fire")
    or string.find(buffs, "atk%-down%-water")
    or string.find(buffs, "atk%-down%-earth")
    or string.find(buffs, "atk%-down%-thunder")
    or string.find(buffs, "atk%-down%-light")
    or string.find(buffs, "atk%-down%-dark") then 
        res = res .. "[[Category:ES:Réduction ATT élémentaire]]"
end
    if string.find(buffs, "atk%-down%-lock") then
        res = res .. "[[Category:ES:Self Réduction ATT]]"
end
    if string.find(buffs, "atk%-down%-return") then 
        res = res .. "[[Category:ES:Renvoi Réduction ATT]]"
end
    if string.find(buffs, "apply%-atk%-down") then 
      res = res .. "[[Category:ES:Buff Réduction ATT]]"
end
    if string.find(buffs, "[^-]atk%-down[^-]") then
        res = res .. "[[Category:ES:Réduction ATT]]"
end
 
--BUFF DEF
 
    if string.find(buffs, "[^-]def%-up[^-]") then
        res = res .. "[[Category:ES:Boost DEF]]"
end
    if string.find(buffs, "def%-up%-fire")
    or string.find(buffs, "def%-up%-water")
    or string.find(buffs, "def%-up%-earth")
    or string.find(buffs, "def%-up%-thunder")
    or string.find(buffs, "def%-up%-light")
    or string.find(buffs, "def%-up%-dark") then 
        res = res .. "[[Category:ES:Boost DEF élémentaire]]"
end
    if string.find(buffs, "self%-def%-up") then
        res = res .. "[[Category:ES:Self Boost DEF]]"
end
    if string.find(buffs, "resist%-def%-down") then
        res = res .. "[[Category:ES:Immune Réduction DEF]]"
end
    if string.find(buffs, "def%-down%-fire")
    or string.find(buffs, "def%-down%-water")
    or string.find(buffs, "def%-down%-earth")
    or string.find(buffs, "def%-down%-thunder")
    or string.find(buffs, "def%-down%-light")
    or string.find(buffs, "def%-down%-dark") then 
        res = res .. "[[Category:ES:Réduction DEF élémentaire]]"
end
    if string.find(buffs, "def%-down%-lock") then
        res = res .. "[[Category:ES:Self Réduction DEF]]"
end
    if string.find(buffs, "def%-down%-return") then 
        res = res .. "[[Category:ES:Renvoi Réduction DEF]]"
end
    if string.find(buffs, "apply%-def%-down") then 
      res = res .. "[[Category:ES:Buff Réduction DEF]]"
end
    if string.find(buffs, "[^-]def%-down[^-]") then
        res = res .. "[[Category:ES:Réduction DEF]]"
end
 
    --BUFF REC
 
    if string.find(buffs, "[^-]rec%-up[^-]") then
        res = res .. "[[Category:ES:Boost REC]]"
end
    if string.find(buffs, "rec%-up%-fire")
    or string.find(buffs, "rec%-up%-water")
    or string.find(buffs, "rec%-up%-earth")
    or string.find(buffs, "rec%-up%-thunder")
    or string.find(buffs, "rec%-up%-light")
    or string.find(buffs, "rec%-up%-dark") then 
        res = res .. "[[Category:ES:Boost REC élémentaire]]"
end
    if string.find(buffs, "self%-rec%-up") then
        res = res .. "[[Category:ES:Self Boost REC]]"
end
    if string.find(buffs, "resist%-rec%-down") then
        res = res .. "[[Category:ES:Immune Réduction REC]]"
end
    if string.find(buffs, "rec%-down%-fire")
    or string.find(buffs, "rec%-down%-water")
    or string.find(buffs, "rec%-down%-earth")
    or string.find(buffs, "rec%-down%-thunder")
    or string.find(buffs, "rec%-down%-light")
    or string.find(buffs, "rec%-down%-dark") then 
        res = res .. "[[Category:ES:Réduction REC élémentaire]]"
end
    if string.find(buffs, "rec%-down%-lock") then
        res = res .. "[[Category:ES:Self Réduction REC]]"
end
    if string.find(buffs, "rec%-down%-return") then 
        res = res .. "[[Category:ES:Renvoi Réduction REC]]"
end
    if string.find(buffs, "apply%-rec%-down") then 
      res = res .. "[[Category:ES:Buff Réduction REC]]"
end
    if string.find(buffs, "[^-]rec%-down[^-]") then
        res = res .. "[[Category:ES:Réduction REC]]"
end
    if string.find(buffs, "[^-]convert%-atk")
    or string.find(buffs, "[^-]convert%-def")
    or string.find(buffs, "[^-]convert%-rec") then
        res = res .. "[[Category:ES:Convertion de Stats]]"
end
    if string.find(buffs, "self%-convert%-atk")
    or string.find(buffs, "self%-convert%-def")
    or string.find(buffs, "self%-convert%-rec") then
        res = res .. "[[Category:ES:Self Convertion de Stats]]"
end
 
    --Elementaire
 
    if string.find(buffs, "element%-fire")
    or string.find(buffs, "element%-water")
    or string.find(buffs, "element%-earth")
    or string.find(buffs, "element%-thunder")
    or string.find(buffs, "element%-light")
    or string.find(buffs, "element%-dark") then 
        res = res .. "[[Category:ES:Ajout Élémentaire]]"
end
    if string.find(buffs, "elements%-weakness")
    or string.find(buffs, "weakness%-fire")
    or string.find(buffs, "weakness%-water")
    or string.find(buffs, "weakness%-earth")
    or string.find(buffs, "weakness%-thunder")
    or string.find(buffs, "weakness%-light")
    or string.find(buffs, "weakness%-dark") then 
        res = res .. "[[Category:ES:EWD]]"
end
 
    --Modificateur d'attaques
 
    if string.find(buffs, "double%-atk") then
        res = res .. "[[Category:ES:Attaque Supplémentaire]]"
end
    if string.find(buffs, "eu%-double%-bb") then
        res = res .. "[[Category:ES:Double BB]]"
end
    if string.find(buffs, "hits%-up") then 
        res = res .. "[[Category:ES:Boost Coups Normaux]]"
end
    if string.find(buffs, "normal%-atk%-aoe") then 
        res = res .. "[[Category:ES:Attaque AOE]]"
end
 
    --PV Ennemis
 
    if string.find(buffs, "drain%-hp") then
        res = res .. "[[Category:ES:Drain PV]]"
end
    if string.find(buffs, "[^-]dot") then
        res = res .. "[[Category:ES:DoT]]"
end
    if string.find(buffs, "[^-]ignore%-def") then
        res = res .. "[[Category:ES:Ignore Def]]"
end
 
    --Critiques
 
    if string.find(buffs, "crit%-dmg%-up") then 
        res = res .. "[[Category:ES:Dégâts Critiques]]"
end
    if string.find(buffs, "[^-]crit%-up") then 
        res = res .. "[[Category:ES:Taux de Coups Critiques]]"
end
    if string.find(buffs, "crit%-weakness") then
        res = res .. "[[Category:ES:Vulnérabilité Critiques]]"
end
    if string.find(buffs, "crit%-bb%-up") then
        res = res .. "[[Category:ES:Boost ATT BB Critiques]]"
end
    if string.find(buffs, "crit%-bb%-fill") then
        res = res .. "[[Category:ES:Remplissage BB Critiques]]"
end
    if string.find(buffs, "self%-crit") then
        res = res .. "[[Category:ES:Self Dégâts Critiques]]"
end
 
    --Drop
 
    if string.find(buffs, "drop%-bc%-up") then
        res = res .. "[[Category:ES:Boost Drop CC]]"
end
    if string.find(buffs, "drop%-hc%-up") then
        res = res .. "[[Category:ES:Boost Drop CV]]"
end
    if string.find(buffs, "drop%-bc%-down") then
        res = res .. "[[Category:ES:Réduction Drop CC]]"
end
    if string.find(buffs, "drop%-hc%-down") then
        res = res .. "[[Category:ES:Réduction Drop CV]]"
end
    if string.find(buffs, "drop%-items%-up") then
        res = res .. "[[Category:ES:Boost Drop Objets]]"
end
    if string.find(buffs, "drop%-zel%-up") then
        res = res .. "[[Category:ES:Boost Drop Zel]]"
end
    if string.find(buffs, "drop%-karma%-up") then
        res = res .. "[[Category:ES:Boost Drop Karma]]"
end
    --Spark
 
    if string.find(buffs, "spark%-dmg%-up") then 
        res = res .. "[[Category:ES:Dégâts Étincelle]]"
end
    if string.find(buffs, "spark%-crit[^-]") then 
        res = res .. "[[Category:ES:Critique Étincelle]]"
end
    if string.find(buffs, "spark%-weakness") then 
        res = res .. "[[Category:ES:Vulnérabilité Étincelle]]"
end
    if string.find(buffs, "spark%-bb%-fill") then 
        res = res .. "[[Category:ES:Remplissage BB Étincelle]]"
end
    if string.find(buffs, "spark%-atk%-up") then 
        res = res .. "[[Category:ES:Boost ATT Étincelle]]"
end
    if string.find(buffs, "spark%-def%-up") then 
        res = res .. "[[Category:ES:Boost DEF Étincelle]]"
end
    if string.find(buffs, "spark%-rec%-up") then 
        res = res .. "[[Category:ES:Boost REC Étincelle]]"
end
    if string.find(buffs, "spark%-up%-up") then
        res = res .. "[[Category:ES:Boost Stats Étincelle]]"
end
    if string.find(buffs, "spark%-crit%-up") then 
        res = res .. "[[Category:ES:Boost Critiques Étincelle]]"
end
    if string.find(buffs, "spark%-regen") then 
        res = res .. "[[Category:ES:Régénération Étincelle]]"
end
    if string.find(buffs, "spark%-drop%-bc") then 
        res = res .. "[[Category:ES:Drop CC Étincelle]]"
end
    if string.find(buffs, "spark%-drop%-hc") then 
        res = res .. "[[Category:ES:Drop CV Étincelle]]"
end
    if string.find(buffs, "spark%-drop%-items") then 
        res = res .. "[[Category:ES:Drop Objets Étincelle]]"
end
    if string.find(buffs, "self%-spark") then 
        res = res .. "[[Category:ES:Self Dégâts Étincelle]]"
end
 
    --BB et OD
 
    if string.find(buffs, "bb%-dmg%-up") then 
        res = res .. "[[Category:ES:Boost ATT BB]]"
end
    if string.find(buffs, "bb%-dmg%-down") then 
        res = res .. "[[Category:ES:Réduction ATT BB]]"
end
    if string.find(buffs, "bb%-instant") then
        res = res .. "[[Category:ES:BB Instant]]"
end
    if string.find(buffs, "bb%-gauge%-up") then 
        res = res .. "[[Category:ES:Boost Vitesse Remplissage BB]]"
end    
    if string.find(buffs, "bb%-gauge%-down") then 
        res = res .. "[[Category:ES:Réduction Vitesse Remplissage BB]]"
end
    if string.find(buffs, "[^-]bb%-fill[^-]") then 
        res = res .. "[[Category:ES:Remplissage BB]]"
end
    if string.find(buffs, "bb%-fill%-dmg") then 
        res = res .. "[[Category:ES:Remplissage BB par Dégâts]]"
end
    if string.find(buffs, "self%-bb") then
        res = res .. "[[Category:ES:Self Boost BB]]"
end
    if string.find(buffs, "od%-instant") then
        res = res .. "[[Category:ES:OD Instant]]"
end
    if string.find(buffs, "od%-gauge%-up") then
        res = res .. "[[Category:ES:Remplissage OD par tour]]"
end
    if string.find(buffs, "od%-fill") then
        res = res .. "[[Category:ES:Remplissage OD par fin de tour]]"
end
 
    --Afflictions
 
    if string.find(buffs, "ailments%-atk%-up") then 
        res = res .. "[[Category:ES:Boost ATT Afflictions]]"
end
    if string.find(buffs, "ailments%-poison")
    or string.find(buffs, "ailments%-weakness")
    or string.find(buffs, "ailments%-sickness")
    or string.find(buffs, "ailments%-injury")
    or string.find(buffs, "ailments%-curse")
    or string.find(buffs, "ailments%-paralysis") then 
        res = res .. "[[Category:ES:Afflictions]]"
end
    if string.find(buffs, "ailments%-apply%-poison")
    or string.find(buffs, "ailments%-apply%-weakness")
    or string.find(buffs, "ailments%-apply%-sickness")
    or string.find(buffs, "ailments%-apply%-injury")
    or string.find(buffs, "ailments%-apply%-curse")
    or string.find(buffs, "ailments%-apply%-paralysis") then  
      res = res .. "[[Category:ES:Buff Afflictions]]"
end
    if string.find(buffs, "ailments%-resist%-poison")
    or string.find(buffs, "ailments%-resist%-weakness")
    or string.find(buffs, "ailments%-resist%-sickness")
    or string.find(buffs, "ailments%-resist%-injury")
    or string.find(buffs, "ailments%-resist%-curse")
    or string.find(buffs, "ailments%-resist%-paralysis") then  
      res = res .. "[[Category:ES:Immune Afflictions]]"
end
    if string.find(buffs, "ailments%-return%-poison")
    or string.find(buffs, "ailments%-return%-weakness")
    or string.find(buffs, "ailments%-return%-sickness")
    or string.find(buffs, "ailments%-return%-injury")
    or string.find(buffs, "ailments%-return%-curse")
    or string.find(buffs, "ailments%-return%-paralysis") then 
      res = res .. "[[Category:ES:Renvoi Afflictions]]"
end
    if string.find(buffs, "negate-ailments") then
        res = res .. "[[Category:ES:Annulation Afflictions]]"
end
    if string.find(buffs, "remove-ailments") then
        res = res .. "[[Category:ES:Suppression Afflictions]]"
end
 
--Résistance et Mitige
 
    if string.find(buffs, "[^-]resist[^-]") then
        res = res .. "[[Category:ES:Mitigeur]]"
end
    if string.find(buffs, "eu%-shield%-rec") then
        res = res .. "[[Category:ES:Bouclier de Mana]]"
end
    if string.find(buffs, "resist%-fire")
    or string.find(buffs, "resist%-water")
    or string.find(buffs, "resist%-earth")
    or string.find(buffs, "resist%-thunder")
    or string.find(buffs, "resist%-light")
    or string.find(buffs, "resist%-dark") then 
        res = res .. "[[Category:ES:Mitigeur Élémentaire]]"
end    
    if string.find(buffs, "shield%-fire")
    or string.find(buffs, "shield%-water")
    or string.find(buffs, "shield%-earth")
    or string.find(buffs, "shield%-thunder")
    or string.find(buffs, "shield%-light")
    or string.find(buffs, "shield%-dark") then 
        res = res .. "[[Category:ES:Barrière Élémentaire]]"
end
    if string.find(buffs, "reduc%-crit") then
        res = res .. "[[Category:ES:Immune Critique]]"
end
    if string.find(buffs, "reduc%-weak") then
        res = res .. "[[Category:ES:Immune EWD]]"
end
    if string.find(buffs, "reduc%-spark") then 
        res = res .. "[[Category:ES:Immune Étincelle]]"
end
    if string.find(buffs, "guard%-1")
    or string.find(buffs, "guard%-2")
    or string.find(buffs, "guard%-3") then
        res = res .. "[[Category:ES:Boost Guard]]"
end
    if string.find(buffs, "resist%-dot") then
        res = res .. "[[Category:ES:Immune DoT]]"
end
    if string.find(buffs, "resist%-ignore%-def") then
        res = res .. "[[Category:ES:Immune Ignore Def]]"
end
    if string.find(buffs, "cancel%-ls")
    or string.find(buffs, "cancel%-es")
    or string.find(buffs, "cancel%-sphere") then
        res = res .. "[[Category:ES:Cancel]]"
end
 
    --Autres
 
    --Qui touche la vie
 
    if string.find(buffs, "[^-]stats-up[^-]") then
        res = res .. "[[Category:ES:Boost Stats]]"
end 
    if string.find(buffs, "[^-]hp-up[^-]") then
        res = res .. "[[Category:ES:Boost PV max]]"
end 
    if string.find(buffs, "resurrection") then
        res = res .. "[[Category:ES:Résurrection]]"
end
    if string.find(buffs, "heal") then
        res = res .. "[[Category:ES:Soin]]"
end
    if string.find(buffs, "[^-]regen[^-]") then
        res = res .. "[[Category:ES:Régénération]]"
end
    if string.find(buffs, "regen%-dmg") then
        res = res .. "[[Category:ES:Régénération par Dégâts]]"
end
    if string.find(buffs, "angel%-idol")
    or string.find(buffs, "angel%-idol%-proc") then
        res = res .. "[[Category:ES:Idole Ange]]"
end
 
    --Cas désespéré.
 
    if string.find(buffs, "target%-on") then
        res = res .. "[[Category:ES:Boost Ciblage]]"
end
    if string.find(buffs, "target%-off") then
        res = res .. "[[Category:ES:Réduction Ciblage]]"
end
    if string.find(buffs, "sg%-stealth") then 
        res = res .. "[[Category:ES:Esquive]]"
end
    return res
end
 
function API.categorize(frame)
    local cats = "";
    cats = cats .. getCats(frame.args.es)
    return cats
end
 
return API
Sauf mention contraire, le contenu de la communauté est disponible sous licence CC-BY-SA .