defmodule Aesir.ZoneServer.Mmo.StatusTypes do
  @moduledoc """
  Status Change type definitions from rAthena.
  Provides mappings between SC atoms and their numeric IDs.
  """

  @type sc_type :: atom() | integer()

  # Common ailments (0-12)
  @common_ailments %{
    sc_stone: 0,
    sc_freeze: 1,
    sc_stun: 2,
    sc_sleep: 3,
    sc_poison: 4,
    sc_curse: 5,
    sc_silence: 6,
    sc_confusion: 7,
    sc_blind: 8,
    sc_bleeding: 9,
    sc_dpoison: 10,
    sc_stonewait: 11
  }

  # Basic status changes (20-299)
  @basic_statuses %{
    sc_provoke: 20,
    sc_endure: 21,
    sc_twohandquicken: 22,
    sc_concentrate: 23,
    sc_hiding: 24,
    sc_cloaking: 25,
    sc_encpoison: 26,
    sc_poisonreact: 27,
    sc_quagmire: 28,
    sc_angelus: 29,
    sc_blessing: 30,
    sc_signumcrucis: 31,
    sc_increaseagi: 32,
    sc_decreaseagi: 33,
    sc_slowpoison: 34,
    sc_impositio: 35,
    sc_suffragium: 36,
    sc_aspersio: 37,
    sc_benedictio: 38,
    sc_kyrie: 39,
    sc_magnificat: 40,
    sc_gloria: 41,
    sc_aeterna: 42,
    sc_adrenaline: 43,
    sc_weaponperfection: 44,
    sc_overthrust: 45,
    sc_maximizepower: 46,
    sc_trickdead: 47,
    sc_loud: 48,
    sc_energycoat: 49,
    sc_brokenarmor: 50,
    sc_brokenweapon: 51,
    sc_hallucination: 52,
    sc_weight50: 53,
    sc_weight90: 54,
    sc_aspdpotion0: 55,
    sc_aspdpotion1: 56,
    sc_aspdpotion2: 57,
    sc_aspdpotion3: 58,
    sc_speedup0: 59,
    sc_speedup1: 60,
    sc_atkpotion: 61,
    sc_matkpotion: 62,
    sc_wedding: 63,
    sc_slowdown: 64,
    sc_ankle: 65,
    sc_keeping: 66,
    sc_barrier: 67,
    sc_stripweapon: 68,
    sc_stripshield: 69,
    sc_striparmor: 70,
    sc_striphelm: 71,
    sc_cp_weapon: 72,
    sc_cp_shield: 73,
    sc_cp_armor: 74,
    sc_cp_helm: 75,
    sc_autoguard: 76,
    sc_reflectshield: 77,
    sc_splasher: 78,
    sc_providence: 79,
    sc_defender: 80,
    sc_magicrod: 81,
    sc_spellbreaker: 82,
    sc_autospell: 83,
    sc_sighttrasher: 84,
    sc_autoberserk: 85,
    sc_spearquicken: 86,
    sc_autocounter: 87,
    sc_sight: 88,
    sc_safetywall: 89,
    sc_ruwach: 90,
    sc_extremityfist: 91,
    sc_explosionspirits: 92,
    sc_combo: 93,
    sc_bladestop_wait: 94,
    sc_bladestop: 95,
    sc_fireweapon: 96,
    sc_waterweapon: 97,
    sc_windweapon: 98,
    sc_earthweapon: 99,
    sc_volcano: 100,
    sc_deluge: 101,
    sc_violentgale: 102,
    sc_watk_element: 103,
    sc_armor: 104,
    sc_armor_element_water: 105,
    sc_nochat: 106,
    sc_protectexp: 107,
    sc_aurablade: 108,
    sc_parrying: 109,
    sc_concentration: 110,
    sc_tensionrelax: 111,
    sc_berserk: 112,
    sc_fury: 113,
    sc_gospel: 114,
    sc_assumptio: 115,
    sc_basilica: 116,
    sc_guildaura: 117,
    sc_magicpower: 118,
    sc_edp: 119,
    sc_truesight: 120,
    sc_windwalk: 121,
    sc_meltdown: 122,
    sc_cartboost: 123,
    sc_chasewalk: 124,
    sc_rejectsword: 125,
    sc_marionette: 126,
    sc_marionette2: 127,
    sc_changeundead: 128,
    sc_jointbeat: 129,
    sc_mindbreaker: 130,
    sc_memorize: 131,
    sc_fogwall: 132,
    sc_spiderweb: 133,
    sc_devotion: 134,
    sc_sacrifice: 135,
    sc_steelbody: 136,
    sc_orcish: 137,
    sc_readystorm: 138,
    sc_readydown: 139,
    sc_readyturn: 140,
    sc_readycounter: 141,
    sc_dodge: 142,
    sc_run: 143,
    sc_shadowweapon: 144,
    sc_adrenaline2: 145,
    sc_ghostweapon: 146,
    sc_kaizel: 147,
    sc_kaahi: 148,
    sc_kaupe: 149,
    sc_onehand: 150,
    sc_preserve: 151,
    sc_battleorders: 152,
    sc_regeneration: 153,
    sc_doublecast: 154,
    sc_gravitation: 155,
    sc_maxoverthrust: 156,
    sc_longing: 157,
    sc_hermode: 158,
    sc_shrink: 159,
    sc_sightblaster: 160,
    sc_winkcharm: 161,
    sc_closeconfine: 162,
    sc_closeconfine2: 163,
    sc_dancing: 164,
    sc_elementalchange: 165,
    sc_richmankim: 166,
    sc_eternalchaos: 167,
    sc_drumbattle: 168,
    sc_nibelungen: 169,
    sc_rokisweil: 170,
    sc_intoabyss: 171,
    sc_siegfried: 172,
    sc_whistle: 173,
    sc_assncros: 174,
    sc_poembragi: 175,
    sc_appleidun: 176,
    sc_modechange: 177,
    sc_humming: 178,
    sc_dontforgetme: 179,
    sc_fortune: 180,
    sc_service4u: 181,
    sc_stop: 182,
    sc_spurt: 183,
    sc_spirit: 184,
    sc_coma: 185,
    sc_intravision: 186,
    sc_incallstatus: 187,
    sc_incstr: 188,
    sc_incagi: 189,
    sc_incvit: 190,
    sc_incint: 191,
    sc_incdex: 192,
    sc_incluk: 193,
    sc_inchit: 194,
    sc_inchitrate: 195,
    sc_incflee: 196,
    sc_incfleerate: 197,
    sc_incmhprate: 198,
    sc_incmsprate: 199,
    sc_incatkrate: 200,
    sc_incmatkrate: 201,
    sc_incdefrate: 202,
    sc_strfood: 203,
    sc_agifood: 204,
    sc_vitfood: 205,
    sc_intfood: 206,
    sc_dexfood: 207,
    sc_lukfood: 208,
    sc_hitfood: 209,
    sc_fleefood: 210,
    sc_batkfood: 211,
    sc_watkfood: 212,
    sc_matkfood: 213,
    sc_scresist: 214,
    sc_xmas: 215,
    sc_warm: 216,
    sc_sun_comfort: 217,
    sc_moon_comfort: 218,
    sc_star_comfort: 219,
    sc_fusion: 220,
    sc_skillrate_up: 221,
    sc_ske: 222,
    sc_kaite: 223,
    sc_swoo: 224,
    sc_ska: 225,
    sc_earthscroll: 226,
    sc_miracle: 227,
    sc_madnesscancel: 228,
    sc_adjustment: 229,
    sc_increasing: 230,
    sc_gatlingfever: 231,
    sc_tatamigaeshi: 232,
    sc_utsusemi: 233,
    sc_bunsinjyutsu: 234,
    sc_kaensin: 235,
    sc_suiton: 236,
    sc_nen: 237,
    sc_knowledge: 238,
    sc_sma: 239,
    sc_fling: 240,
    sc_avoid: 241,
    sc_change: 242,
    sc_bloodlust: 243,
    sc_fleet: 244,
    sc_speed: 245,
    sc_defence: 246,
    sc_incaspdrate: 247,
    sc_incflee2: 248,
    sc_jailed: 249,
    sc_enchantarms: 250,
    sc_magicalattack: 251,
    sc_armorchange: 252,
    sc_criticalwound: 253,
    sc_magicmirror: 254,
    sc_slowcast: 255,
    sc_summer: 256,
    sc_expboost: 257,
    sc_itemboost: 258,
    sc_bossmapinfo: 259,
    sc_lifeinsurance: 260,
    sc_inccri: 261,
    sc_mdef_rate: 265,
    sc_inchealrate: 267,
    sc_pneuma: 268,
    sc_autotrade: 269,
    sc_ksprotected: 270,
    sc_armor_resist: 271,
    sc_spcost_rate: 272,
    sc_commonsc_resist: 273,
    sc_sevenwind: 274,
    sc_def_rate: 275,
    sc_walkspeed: 277,
    sc_merc_fleeup: 278,
    sc_merc_atkup: 279,
    sc_merc_hpup: 280,
    sc_merc_spup: 281,
    sc_merc_hitup: 282,
    sc_merc_quicken: 283,
    sc_rebirth: 284,
    sc_itemscript: 289,
    sc_s_lifepotion: 290,
    sc_l_lifepotion: 291,
    sc_jexpboost: 292,
    sc_hellpower: 294,
    sc_invincible: 295,
    sc_manu_atk: 297,
    sc_manu_def: 298,
    sc_spl_atk: 299
  }

  # 3rd job status changes (300-599)
  @third_job_statuses %{
    sc_spl_def: 300,
    sc_manu_matk: 301,
    sc_spl_matk: 302,
    sc_food_str_cash: 303,
    sc_food_agi_cash: 304,
    sc_food_vit_cash: 305,
    sc_food_dex_cash: 306,
    sc_food_int_cash: 307,
    sc_food_luk_cash: 308,
    sc_fear: 309,
    sc_burning: 310,
    sc_freezing: 311,
    # Rune Knight
    sc_enchantblade: 312,
    sc_deathbound: 313,
    sc_millenniumshield: 314,
    sc_crushstrike: 315,
    sc_refresh: 316,
    sc_reuse_refresh: 317,
    sc_giantgrowth: 318,
    sc_stonehardskin: 319,
    sc_vitalityactivation: 320,
    sc_stormblast: 321,
    sc_fightingspirit: 322,
    sc_abundance: 323,
    # Arch Bishop
    sc_adoramus: 324,
    sc_epiclesis: 325,
    sc_oratio: 326,
    sc_laudaagnus: 327,
    sc_laudaramus: 328,
    sc_renovatio: 329,
    sc_expiatio: 330,
    sc_duplelight: 331,
    sc_secrament: 332,
    # Warlock
    sc_whiteimprison: 333,
    sc_marshofabyss: 334,
    sc_recognizedspell: 335,
    sc_stasis: 336,
    sc_sphere_1: 337,
    sc_sphere_2: 338,
    sc_sphere_3: 339,
    sc_sphere_4: 340,
    sc_sphere_5: 341,
    sc_reading_sb: 342,
    sc_freeze_sp: 343,
    # Ranger
    sc_fearbreeze: 344,
    sc_electricshocker: 345,
    sc_wugdash: 346,
    sc_bite: 347,
    sc_camouflage: 348,
    # Mechanic
    sc_acceleration: 349,
    sc_hovering: 350,
    sc_shapeshift: 351,
    sc_infraredscan: 352,
    sc_analyze: 353,
    sc_magneticfield: 354,
    sc_neutralbarrier: 355,
    sc_neutralbarrier_master: 356,
    sc_stealthfield: 357,
    sc_stealthfield_master: 358,
    sc_overheat: 359,
    sc_overheat_limitpoint: 360,
    # Guillotine Cross
    sc_venomimpress: 361,
    sc_poisoningweapon: 362,
    sc_weaponblocking: 363,
    sc_cloakingexceed: 364,
    sc_hallucinationwalk: 365,
    sc_hallucinationwalk_postdelay: 366,
    sc_rollingcutter: 367,
    sc_toxin: 368,
    sc_paralyse: 369,
    sc_venombleed: 370,
    sc_magicmushroom: 371,
    sc_deathhurt: 372,
    sc_pyrexia: 373,
    sc_oblivioncurse: 374,
    sc_leechesend: 375,
    # Royal Guard
    sc_reflectdamage: 376,
    sc_forceofvanguard: 377,
    sc_shieldspell_hp: 378,
    sc_shieldspell_sp: 379,
    sc_shieldspell_atk: 380,
    sc_exeedbreak: 381,
    sc_prestige: 382,
    sc_banding: 383,
    sc_banding_defence: 384,
    sc_earthdrive: 385,
    sc_inspiration: 386,
    # Sorcerer
    sc_spellfist: 387,
    sc_crystalize: 388,
    sc_striking: 389,
    sc_warmer: 390,
    sc_vacuum_extreme: 391,
    sc_propertywalk: 392,
    # Minstrel/Wanderer
    sc_swingdance: 393,
    sc_symphonyoflover: 394,
    sc_moonlitserenade: 395,
    sc_rushwindmill: 396,
    sc_echosong: 397,
    sc_harmonize: 398,
    sc_voiceofsiren: 399,
    sc_deepsleep: 400,
    sc_sircleofnature: 401,
    sc_gloomyday: 402,
    sc_gloomyday_sk: 403,
    sc_songofmana: 404,
    sc_dancewithwug: 405,
    sc_saturdaynightfever: 406,
    sc_leradsdew: 407,
    sc_melodyofsink: 408,
    sc_beyondofwarcry: 409,
    sc_unlimitedhummingvoice: 410,
    sc_sitdown_force: 411,
    sc_netherworld: 412,
    # Sura
    sc_crescentelbow: 413,
    sc_cursedcircle_atker: 414,
    sc_cursedcircle_target: 415,
    sc_lightningwalk: 416,
    sc_raisingdragon: 417,
    sc_gt_energygain: 418,
    sc_gt_change: 419,
    sc_gt_revitalize: 420,
    # Genetic
    sc_gn_cartboost: 421,
    sc_thornstrap: 422,
    sc_bloodsucker: 423,
    sc_smokepowder: 424,
    sc_teargas: 425,
    sc_mandragora: 426,
    sc_stomachache: 427,
    sc_mysterious_powder: 428,
    sc_melon_bomb: 429,
    sc_banana_bomb: 430,
    sc_banana_bomb_sitdown: 431,
    sc_savage_steak: 432,
    sc_cocktail_warg_blood: 433,
    sc_minor_bbq: 434,
    sc_siroma_ice_tea: 435,
    sc_drocera_herb_steamed: 436,
    sc_putti_tails_noodles: 437,
    sc_boost500: 438,
    sc_full_swing_k: 439,
    sc_mana_plus: 440,
    sc_mustle_m: 441,
    sc_life_force_f: 442,
    sc_extract_white_potion_z: 443,
    sc_vitata_500: 444,
    sc_extract_salamine_juice: 445,
    # Shadow Chaser
    sc__reproduce: 446,
    sc__autoshadowspell: 447,
    sc__shadowform: 448,
    sc__bodypaint: 449,
    sc__invisibility: 450,
    sc__deadlyinfect: 451,
    sc__enervation: 452,
    sc__groomy: 453,
    sc__ignorance: 454,
    sc__laziness: 455,
    sc__unlucky: 456,
    sc__weakness: 457,
    sc__stripaccessory: 458,
    sc__manhole: 459,
    sc__bloodylust: 460,
    # Elemental Spirits
    sc_circle_of_fire: 461,
    sc_circle_of_fire_option: 462,
    sc_fire_cloak: 463,
    sc_fire_cloak_option: 464,
    sc_water_screen: 465,
    sc_water_screen_option: 466,
    sc_water_drop: 467,
    sc_water_drop_option: 468,
    sc_water_barrier: 469,
    sc_wind_step: 470,
    sc_wind_step_option: 471,
    sc_wind_curtain: 472,
    sc_wind_curtain_option: 473,
    sc_zephyr: 474,
    sc_solid_skin: 475,
    sc_solid_skin_option: 476,
    sc_stone_shield: 477,
    sc_stone_shield_option: 478,
    sc_power_of_gaia: 479,
    sc_pyrotechnic: 480,
    sc_pyrotechnic_option: 481,
    sc_heater: 482,
    sc_heater_option: 483,
    sc_tropic: 484,
    sc_tropic_option: 485,
    sc_aquaplay: 486,
    sc_aquaplay_option: 487,
    sc_cooler: 488,
    sc_cooler_option: 489,
    sc_chilly_air: 490,
    sc_chilly_air_option: 491,
    sc_gust: 492,
    sc_gust_option: 493,
    sc_blast: 494,
    sc_blast_option: 495,
    sc_wild_storm: 496,
    sc_wild_storm_option: 497,
    sc_petrology: 498,
    sc_petrology_option: 499,
    sc_cursed_soil: 500,
    sc_cursed_soil_option: 501,
    sc_upheaval: 502,
    sc_upheaval_option: 503,
    sc_tidal_weapon: 504,
    sc_tidal_weapon_option: 505,
    sc_rock_crusher: 506,
    sc_rock_crusher_atk: 507,
    # Guild Aura
    sc_leadership: 508,
    sc_glorywounds: 509,
    sc_soulcold: 510,
    sc_hawkeyes: 511,
    sc_odins_power: 512,
    sc_raid: 513,
    # Sorcerer Extra
    sc_fire_insignia: 514,
    sc_water_insignia: 515,
    sc_wind_insignia: 516,
    sc_earth_insignia: 517,
    sc_push_cart: 518,
    # Warlock Spellbooks
    sc_spellbook1: 519,
    sc_spellbook2: 520,
    sc_spellbook3: 521,
    sc_spellbook4: 522,
    sc_spellbook5: 523,
    sc_spellbook6: 524,
    sc_maxspellbook: 525,
    sc_incmhp: 526,
    sc_incmsp: 527,
    sc_partyflee: 528,
    # Kagerou & Oboro
    sc_meikyousisui: 529,
    sc_jyumonjikiri: 530,
    sc_kyougaku: 531,
    sc_izayoi: 532,
    sc_zenkai: 533,
    sc_kagehumi: 534,
    sc_kyomu: 535,
    sc_kagemusya: 536,
    sc_zangetsu: 537,
    sc_gensou: 538,
    sc_akaitsuki: 539,
    # Homunculus S
    sc_style_change: 540,
    sc_tinder_breaker: 541,
    sc_tinder_breaker2: 542,
    sc_cbc: 543,
    sc_eqc: 544,
    sc_goldene_ferse: 545,
    sc_angriffs_modus: 546,
    sc_overed_boost: 547,
    sc_light_of_regene: 548,
    sc_ash: 549,
    sc_granitic_armor: 550,
    sc_magma_flow: 551,
    sc_pyroclastic: 552,
    sc_paralysis: 553,
    sc_pain_killer: 554,
    sc_hanbok: 555,
    # Vellum Weapon
    sc_defset: 556,
    sc_mdefset: 557,
    sc_darkcrow: 558,
    sc_full_throttle: 559,
    sc_rebound: 560,
    sc_unlimit: 561,
    sc_kings_grace: 562,
    sc_telekinesis_intense: 563,
    sc_offertorium: 564,
    sc_frigg_song: 565,
    sc_monster_transform: 566,
    sc_angel_protect: 567,
    sc_illusiondoping: 568,
    sc_flashcombo: 569,
    sc_moonstar: 570,
    sc_super_star: 571,
    # Rebellion
    sc_heat_barrel: 572,
    sc_magicalbullet: 573,
    sc_p_alter: 574,
    sc_e_chain: 575,
    sc_c_marker: 576,
    sc_anti_m_blast: 577,
    sc_b_trap: 578,
    sc_h_mine: 579,
    sc_qd_shot_ready: 580,
    sc_mtf_aspd: 581,
    sc_mtf_rangeatk: 582,
    sc_mtf_matk: 583,
    sc_mtf_mleatked: 584,
    sc_mtf_cridamage: 585,
    sc_oktoberfest: 586,
    sc_strangelights: 587,
    sc_decoration_of_music: 588,
    sc_quest_buff1: 589,
    sc_quest_buff2: 590,
    sc_quest_buff3: 591,
    sc_all_riding: 592,
    sc_teargas_sob: 593,
    sc__feintbomb: 594,
    sc__chaos: 595,
    sc_chasewalk2: 596,
    sc_vacuum_extreme_postdelay: 597,
    sc_mtf_aspd2: 598,
    sc_mtf_rangeatk2: 599
  }

  # Additional status changes (600+)
  @additional_statuses %{
    sc_mtf_matk2: 600,
    sc_2011rwc_scroll: 601,
    sc_jp_event04: 602,
    sc_mtf_mhp: 603,
    sc_mtf_msp: 604,
    sc_mtf_pumpkin: 605,
    sc_mtf_hitflee: 606,
    sc_crifood: 607,
    sc_atthaste_cash: 608,
    # Item Reuse Limits
    sc_reuse_limit_a: 609,
    sc_reuse_limit_b: 610,
    sc_reuse_limit_c: 611,
    sc_reuse_limit_d: 612,
    sc_reuse_limit_e: 613,
    sc_reuse_limit_f: 614,
    sc_reuse_limit_g: 615,
    sc_reuse_limit_h: 616,
    sc_reuse_limit_mtf: 617,
    sc_reuse_limit_aspd_potion: 618,
    sc_reuse_millenniumshield: 619,
    sc_reuse_crushstrike: 620,
    sc_reuse_stormblast: 621,
    sc_all_riding_reuse_limit: 622,
    sc_reuse_limit_ecl: 623,
    sc_reuse_limit_recall: 624,
    sc_promote_health_reserch: 625,
    sc_energy_drink_reserch: 626,
    sc_norecover_state: 627,
    # Summoner
    sc_suhide: 628,
    sc_su_stoop: 629,
    sc_spritemable: 630,
    sc_catnippowder: 631,
    sc_sv_roottwist: 632,
    sc_bitescar: 633,
    sc_arclousedash: 634,
    sc_tunaparty: 635,
    sc_shrimp: 636,
    sc_freshshrimp: 637,
    sc_active_monster_transform: 638,
    sc_cloud_kill: 639,
    sc_ljosalfar: 640,
    sc_mermaid_longing: 641,
    sc_hat_effect: 642,
    sc_flowersmoke: 643,
    sc_fstone: 644,
    sc_happiness_star: 645,
    sc_maple_falls: 646,
    sc_time_accessory: 647,
    sc_magical_feather: 648,
    sc_gvg_giant: 649,
    sc_gvg_golem: 650,
    sc_gvg_stun: 651,
    sc_gvg_stone: 652,
    sc_gvg_freez: 653,
    sc_gvg_sleep: 654,
    sc_gvg_curse: 655,
    sc_gvg_silence: 656,
    sc_gvg_blind: 657,
    sc_clan_info: 658,
    sc_swordclan: 659,
    sc_arcwandclan: 660,
    sc_goldenmaceclan: 661,
    sc_crossbowclan: 662,
    sc_jumpingclan: 663,
    sc_tarotcard: 664
  }

  # 4th job and newer statuses
  @fourth_job_statuses %{
    # 4th Job Common Status
    sc_handicapstate_deepblind: 850,
    sc_handicapstate_deepsilence: 851,
    sc_handicapstate_lassitude: 852,
    sc_handicapstate_frostbite: 853,
    sc_handicapstate_swooning: 854,
    sc_handicapstate_lightningstrike: 855,
    sc_handicapstate_crystallization: 856,
    sc_handicapstate_conflagration: 857,
    sc_handicapstate_misfortune: 858,
    sc_handicapstate_deadlypoison: 859,
    sc_handicapstate_depression: 860,
    sc_handicapstate_holyflame: 861,
    # Dragon Knight
    sc_servantweapon: 862,
    sc_servant_sign: 863,
    sc_chargingpierce: 864,
    sc_chargingpierce_count: 865,
    sc_dragonic_aura: 866,
    sc_vigor: 867,
    # Arch Mage
    sc_deadly_defeasance: 868,
    sc_climax_des_hu: 869,
    sc_climax: 870,
    sc_climax_earth: 871,
    sc_climax_bloom: 872,
    sc_climax_cryimp: 873,
    # Windhawk
    sc_windsign: 874,
    sc_crescivebolt: 875,
    sc_calamitygale: 876,
    # Cardinal
    sc_mediale: 877,
    sc_a_vita: 878,
    sc_a_telum: 879,
    sc_pre_acies: 880,
    sc_competentia: 881,
    sc_religio: 882,
    sc_benedictum: 883,
    # Meister
    sc_axe_stomp: 884,
    sc_a_machine: 885,
    sc_d_machine: 886,
    sc_abr_battle_warior: 887,
    sc_abr_dual_cannon: 888,
    sc_abr_mother_net: 889,
    sc_abr_infinity: 890,
    # Shadow Cross
    sc_shadow_exceed: 891,
    sc_dancing_knife: 892,
    sc_potent_venom: 893,
    sc_shadow_scar: 894,
    sc_e_slash_count: 895,
    sc_shadow_weapon: 896,
    # Imperial Guard
    sc_guard_stance: 897,
    sc_attack_stance: 898,
    sc_guardian_s: 899,
    sc_rebound_s: 900,
    sc_holy_s: 901,
    sc_ultimate_s: 902,
    sc_spear_scar: 903,
    sc_shield_power: 904,
    # Elemental Master
    sc_spell_enchanting: 905,
    sc_summon_elemental_ardor: 906,
    sc_summon_elemental_diluvio: 907,
    sc_summon_elemental_procella: 908,
    sc_summon_elemental_terremotus: 909,
    sc_summon_elemental_serpens: 910,
    sc_elemental_veil: 911,
    # Troubadour/Trouvere
    sc_mystic_symphony: 912,
    sc_kvasir_sonata: 913,
    sc_soundblend: 914,
    sc_gef_nocturn: 915,
    sc_ain_rhapsody: 916,
    sc_musical_interlude: 917,
    sc_jawaii_serenade: 918,
    sc_pron_march: 919,
    sc_roseblossom: 920,
    # Inquisitor
    sc_powerful_faith: 921,
    sc_sincere_faith: 922,
    sc_firm_faith: 923,
    sc_holy_oil: 924,
    sc_first_brand: 925,
    sc_second_brand: 926,
    sc_second_judge: 927,
    sc_third_exor_flame: 928,
    sc_first_faith_power: 929,
    sc_massive_f_blaster: 930,
    # Biolo
    sc_protectshadowequip: 931,
    sc_researchreport: 932,
    sc_bo_hell_dusty: 933,
    sc_bionic_woodenwarrior: 934,
    sc_bionic_wooden_fairy: 935,
    sc_bionic_creeper: 936,
    sc_bionic_helltree: 937,
    # Abyss Chaser
    sc_shadow_strip: 938,
    sc_abyss_dagger: 939,
    sc_abyssforceweapon: 940,
    sc_abyss_slayer: 941,
    # Special
    sc_powerup: 951,
    sc_agiup: 952,
    sc_protection: 953
  }

  # Merge all status maps
  @all_statuses Map.merge(
                  @common_ailments,
                  Map.merge(
                    @basic_statuses,
                    Map.merge(
                      @third_job_statuses,
                      Map.merge(@additional_statuses, @fourth_job_statuses)
                    )
                  )
                )

  # Create reverse mapping (ID to atom)
  @id_to_atom_map Enum.into(@all_statuses, %{}, fn {atom, id} -> {id, atom} end)

  @doc """
  Converts a status change atom to its numeric ID.
  Returns nil if the status type is not found.
  """
  @spec atom_to_id(atom()) :: integer() | nil
  def atom_to_id(atom) when is_atom(atom) do
    Map.get(@all_statuses, atom)
  end

  @doc """
  Converts a numeric ID to its status change atom.
  Returns nil if the ID is not found.
  """
  @spec id_to_atom(integer()) :: atom() | nil
  def id_to_atom(id) when is_integer(id) do
    Map.get(@id_to_atom_map, id)
  end

  @doc """
  Returns all status change atoms.
  """
  @spec all_atoms() :: [atom()]
  def all_atoms do
    Map.keys(@all_statuses)
  end

  @doc """
  Returns all status change IDs.
  """
  @spec all_ids() :: [integer()]
  def all_ids do
    Map.values(@all_statuses)
  end

  @doc """
  Checks if the given atom is a valid status change type.
  """
  @spec valid_sc?(atom()) :: boolean()
  def valid_sc?(atom) when is_atom(atom) do
    Map.has_key?(@all_statuses, atom)
  end

  @doc """
  Checks if the given ID is a valid status change ID.
  """
  @spec valid_id?(integer()) :: boolean()
  def valid_id?(id) when is_integer(id) do
    Map.has_key?(@id_to_atom_map, id)
  end

  @doc """
  Returns all common ailment status changes.
  """
  @spec common_ailments() :: %{atom() => integer()}
  def common_ailments, do: @common_ailments

  @doc """
  Checks if a status change is a common ailment.
  """
  @spec is_common_ailment?(atom() | integer()) :: boolean()
  def is_common_ailment?(sc) when is_atom(sc) do
    Map.has_key?(@common_ailments, sc)
  end

  def is_common_ailment?(id) when is_integer(id) do
    case id_to_atom(id) do
      nil -> false
      atom -> is_common_ailment?(atom)
    end
  end

  @doc """
  Returns the SC_NONE value (-1).
  """
  @spec sc_none() :: integer()
  def sc_none, do: -1

  @doc """
  Returns the SC_COMMON_MIN value.
  """
  @spec sc_common_min() :: integer()
  def sc_common_min, do: 0

  @doc """
  Returns the SC_COMMON_MAX value.
  """
  @spec sc_common_max() :: integer()
  def sc_common_max, do: 11
end
