#[SOLVED] Adding a stagger effect upon applying a SpEffect

20 messages · Page 1 of 1 (latest)

rustic flame
#

I want to add a stagger effect upon applying Madness to an enemy (similar to how bleed works).

I've already done the param edits to make sure NPC's can receive madness buildup ect. I just can't figure out how to apply the stun.

Appreciate any help I can get.

What I've tried:
Tried reverse engineering a few different attacks that cause stun via (bullets, atkparam, ect) with no success.

honest carbon
#

You're gonna wanna look at at c9997.hks function ExecDamage and its mention of GetDamageSpecialAttribute

rustic flame
#

Opened c9997.hks with notepad++ and Visual Studio Code. I see 9 references to ExecDamage, but 0 references to GetDamageSpecialAttribute

honest carbon
#

Look up the community file in tools and resources

rustic flame
#

I've taken a look at the file, would it not be simpler to create a bullet/atkparam that applies the stagger effect using the already existing ATKPARAM_DMGTYPE_NEW? Or is this not possible?

honest carbon
#

The bullet would be owner by the enemy who was hit, so you would need to make sure it would hit only the owner

#

But should also be possible

#

HKS is just how it's handled for bleed and frost

rustic flame
#

Thanks, if anybody could guide me, or point me to relevant guides about how to create a bullet that:

  1. Generates upon an enemy receiving enough buildup to proc a status

From there I should be fine making sure all the right boxes are ticked for owner of the bullet ect ect. I just have no idea how to generate a bullet.

south turret
rustic flame
# south turret Check any madness, poison, rot, bleed, or sleep speffect. They all should genera...

I tried applying the stagger to any referenced Bullet > AtkParam I could find, I also know I was modifying the correct params, as I could change other values and see the effects in real time. However, applying the ATKPARAM_DMGTYPE_NEW just never seemed to work. There's a decent chance I'm doing it wrong though.

Edit: Actually this might be because of the c9997.hks

When looking in there I saw references that applied the stagger effect depending on the status applied (because they all use the same AtkParam)...

If modifying the .hks is the only way (although I have no idea how to write the code) then I'll do it, but surely there's a way around this... Even if it means re-creating the params from scratch.

rustic flame
#

Still looking for help with this if possible, thanks

pearl hedge
#

I did it editing the c9997.hks.

dont remenber exactly how right now, but i just followed same code as with bleed stagger when proc

rustic flame
#

Thanks for the input, still haven't figured out how to do this without editing the .hks which is a shame

pearl hedge
#

I doubt this can be done without hks editing. At least, with satisfactory results

#

but its quite easy, decompile the a9997.hks with hkLib, and edit around the line 4095 this

    -- Added Madness inflicts stagger on proc
    if (env(GetDamageSpecialAttribute, STATUS_EFFECT_BLOOD) == TRUE or env(GetDamageSpecialAttribute, STATUS_EFFECT_COLD) == TRUE  or env(GetDamageSpecialAttribute, STATUS_EFFECT_MADNESS) == TRUE) and (damage_level == DAMAGE_LEVEL_NONE or damage_level == DAMAGE_LEVEL_MINIMUM or damage_level == DAMAGE_LEVEL_SMALL or damage_level == DAMAGE_LEVEL_MIDDLE) and env(GetSpEffectID, 5890) == FALSE and env(GetSpEffectID, 5891) == FALSE and env(GetSpEffectID, 89) == TRUE then
        damage_level = DAMAGE_LEVEL_MIDDLE;
    elseif (env(GetDamageSpecialAttribute, STATUS_EFFECT_BLOOD) == TRUE or env(GetDamageSpecialAttribute, STATUS_EFFECT_COLD) == TRUE  or env(GetDamageSpecialAttribute, STATUS_EFFECT_MADNESS) == TRUE) and damage_level == DAMAGE_LEVEL_NONE and env(GetSpEffectID, 5890) == FALSE and env(GetSpEffectID, 5891) == FALSE and IsExistAnime(8040) == TRUE then
        damage_level = DAMAGE_LEVEL_MIDDLE;
    elseif (env(GetDamageSpecialAttribute, STATUS_EFFECT_BLOOD) == TRUE or env(GetDamageSpecialAttribute, STATUS_EFFECT_COLD) == TRUE  or env(GetDamageSpecialAttribute, STATUS_EFFECT_MADNESS) == TRUE) and damage_level == DAMAGE_LEVEL_MINIMUM and env(GetSpEffectID, 5890) == FALSE and env(GetSpEffectID, 5891) == FALSE and (IsExistAnime(8040) == TRUE or IsExistAnime(8050) == TRUE) then
        damage_level = DAMAGE_LEVEL_LARGE;
    elseif (env(GetDamageSpecialAttribute, STATUS_EFFECT_BLOOD) == TRUE or env(GetDamageSpecialAttribute, STATUS_EFFECT_COLD) == TRUE  or env(GetDamageSpecialAttribute, STATUS_EFFECT_MADNESS) == TRUE) and (damage_level == DAMAGE_LEVEL_SMALL or damage_level == DAMAGE_LEVEL_MIDDLE or damage_level == DAMAGE_LEVEL_PUSH) and env(GetSpEffectID, 5890) == FALSE and env(GetSpEffectID, 5891) == FALSE and (IsExistAnime(8040) == TRUE or IsExistAnime(8050) == TRUE) then
        damage_level = DAMAGE_LEVEL_LARGE;
    end
    if ExecNpcDamage(damage_level, damage_type, is_damaged) == TRUE then
        return TRUE;
    end
    if ExecJumpDamage(damage_level, damage_type, is_damaged) == TRUE then
        return TRUE;
    end
    if ignore_guard_block == TRUE and env(GetDamageSpecialAttribute, STATUS_EFFECT_BLOOD) == FALSE and env(GetDamageSpecialAttribute, STATUS_EFFECT_COLD) == FALSE  and env(GetDamageSpecialAttribute, STATUS_EFFECT_MADNESS) == FALSE and damage_type == DAMAGE_TYPE_GUARD then
        if env(GetSpEffectID, 5827) == TRUE then
            return FALSE;
        elseif env(GetSpEffectID, 5827) == FALSE and (env(GetGuardLevelAction) == GUARD_LEVEL_NONE or env(GetGuardLevelAction) == GUARD_LEVEL_SMALL) then
            if ExecNoSyncAddGuardDamage(damage_level, is_damaged) == TRUE then
                return FALSE;
            end
            return FALSE;
        end
    end```
#

then compile back I think it is not necessary to compile back? dont remember right now

south turret
#

Nor any ER lua, can just leave it decompiled. Works fine :)

rustic flame
#

Thanks again so much for the help, it's really appreciated