• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

BlzSetAbilityRealLevelField is not working

Status
Not open for further replies.
Level 24
Joined
Jun 26, 2020
Messages
1,853
Hello, this is the first time I'm using this function, and its not working, I tried to change the damage of an ability based in Cluster Rockets and is not changing, I'm sure that everything is ok, can you tell me what's wrong please?
Lua:
OnMapInit(function ()
    local Spell = FourCC('A024')
    local StrDmgFactor = 0.15
    local AgiDmgFactor = 0.15
    local IntDmgFactor = 0.15
    local AttackFactor = 0.5

    RegisterSpellEffectEvent(Spell, function ()
        local caster = GetSpellAbilityUnit()
        -- Calculating the damage
        local damage = GetAttributeDamage(caster, StrDmgFactor, AgiDmgFactor, IntDmgFactor) +
                       GetAvarageAttack(caster) * AttackFactor
        -- --
        BlzSetAbilityRealLevelField(BlzGetUnitAbility(caster, Spell), ABILITY_RLF_DAMAGE_AMOUNT_NCS1, 0, damage/12)
    end)

end)
The ability in the object editor
1653800737763.png

The raw values
1653800757605.png
 
Level 39
Joined
Feb 27, 2007
Messages
5,031
This could be wildly off the mark but I remember Cluster Rockets specifically being a dumb as fuck ability to try to modify in the editor. There was always some problem with it or shit didn't work right; I can't quite remember but something like that can maybe be corroborated by @Kyrbi0. If that's the case maybe it affects this. Try modifying a different ability to see if it works... or even a different field on this ability.
 

Kyrbi0

Arena Moderator
Level 45
Joined
Jul 29, 2008
Messages
9,510
I have no clue if Reforged has messed things up further, but I know that even back in 1.16 things were wonky... The Wc3 Ability Insight Google doc has loads of useful info on abilities, but very little on Cluster Rockets. :<

I vaguely recall that the "number of rockets" is purely cosmetic; the damage is set by the ability rather than by the number of rockets.
 
Level 24
Joined
Jun 26, 2020
Messages
1,853
So my option is replicate the ability, the problem, I don't know how exactly works and I wanna make it similar, this is what I achieve, but I don't get a similar result:
Lua:
OnMapInit(function ()
    local Spell = FourCC('A029')
    local StrDmgFactor = 0.15
    local AgiDmgFactor = 0.15
    local IntDmgFactor = 0.15
    local AttackFactor = 0.5
    -- The same as it is in the object editor
    local Area = 200.
    local Order = 852652 -- clusterrockets

    RegisterSpellEffectEvent(Spell, function ()
        local caster = GetSpellAbilityUnit()
        local owner = GetOwningPlayer(caster)
        local cx = GetUnitX(caster)
        local cy = GetUnitY(caster)
        local x = GetSpellTargetX()
        local y = GetSpellTargetY()
        -- Calculating the damage
        local damage = GetAttributeDamage(caster, StrDmgFactor, AgiDmgFactor, IntDmgFactor) +
                       GetAvarageAttack(caster) * AttackFactor
        -- --
        damage = damage / 6
        local counter = 6
        Timed.echo(function ()
            if counter == 0 or GetUnitCurrentOrder(caster) ~= Order then return true end
            local angle = 2 * math.pi * math.random()
            local dist = Area * math.random()
            local tx = x + dist * math.cos(angle)
            local ty = y + dist * math.sin(angle)
            local missile = Missiles:create(cx, cy, 25, tx, ty, 0)
            missile.source = caster
            missile.owner = owner
            missile.damage = damage
            missile:model("Abilities\\Spells\\Other\\TinkerRocket\\TinkerRocketMissile.mdl")
            missile:speed(700.)
            missile:arc(60.)
            missile.onFinish = function ()
                ForUnitsInRange(missile.x, missile.y, Area, function (u)
                    if IsUnitEnemy(u, missile.owner) then
                        Damage.apply(caster, u, damage, true, false, udg_Machine, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
                        -- Stun
                        DummyCast(owner,
                                    GetUnitX(caster), GetUnitY(caster),
                                    STUN_SPELL,
                                    STUN_ORDER,
                                    2,
                                    CastType.TARGET,
                                    u)
                    end
                end)
            end
            missile:launch()
            counter = counter - 1
        end, 0.25)
    end)

end)
 
Status
Not open for further replies.
Top