Skip to content

Conversation

@AltimorTASDK
Copy link

@AltimorTASDK AltimorTASDK commented Jan 24, 2026

The new language can be used by using a .spell extension instead of .json
Example rewrite of Gong Strike:

identifier = "gong_strike";
loc_name = "Gong Strike";
max_lvl = 16;
min_lvl = 1;
statsForSkillGem = [
    { type = "FLAT"; min = 15.0; max = 30.0; stat = "endurance_charge_on_hit"; }
];

cast_finish_animation id = "spell_taunt";

config {
    tags tags = ["weapon_skill", "damage", "melee", "physical"];
    castingWeapon = "MELEE_WEAPON";
    style = "str";
    cast_time_ticks = 0;
    cooldown_ticks = 40;
    ene_cost { min = 6.0; max = 8.0; }
    mana_cost { min = 1.0; max = 2.0; }
    swing_arm = false;
}

on_cast {
    // note the omitted semicolons; these are combined into one spell component part
    sound("roe_sfx:spell_gongstrike", 1.0)
    sound("roe_sfx:spell_hit_heavy", 1.0)
    particles_in_radius("minecraft:cloud", radius=2.0, particle_count=300.0, shape="CIRCLE_2D", height=0.5, y_rand=0.1)
    particles_in_radius("minecraft:explosion", radius=2.0, particle_count=5.0, shape="CIRCLE_2D", height=0.5, y_rand=0.1);

    if (caster_has_mns_effect("fighter_stance")) {
        select (in_front(5.0, 2.5, "enemies")) {
            damage("Physical", "gong_strike_fighter", disable_knockback=true);
        }
    } else if (caster_has_mns_effect("defender_stance")) {
        select (in_front(4.0, 2.0, "enemies")) {
            damage("Physical", "gong_strike", disable_knockback=true)
            exile_effect("stun", 1.0, "GIVE_STACKS", 10.0);
        }
    } else {
        select (in_front(4.0, 2.0, "enemies")) {
            damage("Physical", "gong_strike_plain", disable_knockback=true);
        }
    }
}

Significant features not showcased are combining conditions with &&, inverting conditions (is_false shouldn't be used directly), adding en_preds, and per_entity_hit:

if (caster_has_mns_effect("defender_stance") && !en.has_mns_effect("slow")) {
    damage("Physical", "primary_hit", disable_knockback=true) per_entity_hit {
        select (aoe(3.0, "enemies")) damage("Physical", "secondary_hit", disable_knockback=true)
    }
}

Selectors can also be combined with ||:

select (in_front(5.0, 2.5, "enemies") || aoe(3.0, "enemies")) {
    /* ... */
}

Oh yeah and entities:

entity my_sick_entity {
    if (x_ticks_condition(5.0)) {
        // idk do somethin
    }
}

Requires mahjerion/Library-of-Exile-Rework#8

KNOWN ISSUE: constructs like if (!(cond1() && cond2())) or if (cond1() && cond2()) { } else { } don't work properly because mns doesn't yet support OR in conditions, which this is equivalent to

@AltimorTASDK AltimorTASDK marked this pull request as draft January 25, 2026 08:56
@AltimorTASDK
Copy link
Author

gonna add || to if conditions and fix the wrong behavior when inverting compound conditions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant