Jump to content

Custom Buff on opening Loot windows / UI windows


Recommended Posts

hey all -

the small friend group I play with will be playing soon, and since we've played a fair share on default settings, I decided we will be playing on Warrior difficulty, with Sprinting zombies (I would go higher but I dont think they would like the big jump) - one thing is for certain though, there is a chance that a "freeze" can happen when attempting to open loot, and with a higher difficulty and faster zombies, this will lead to some unfair hits and even death, I fear.

I was just wondering, is it possible to make a buff that would only pop up when attempting to loot and or when an active window is open? a buff that would give you invincibility to damage and debuffs, but only while looting and with UI windows up. I know the people I play with would not exploit such a feature, so im not worried about that, it is just a means of QOL as the game will sometimes freeze on window openings/looting for upwards of 4 seconds.

(P.S yes I know it is a skill issue to not wait until the area is fully clear if you dont want to be hit, but the random freezing is not - please keep the comments on topic, thank you)

Link to comment
Share on other sites

In the comments of the buffs.xml file, there are both "onSelfOpenLootContainer" and "onSelfLootContainer" triggered effects. I have never used either, but I'm guessing that the former is triggered when the loot container is opened. I'm also guessing the latter is triggered either when the loot container is closed, or when the player removes all the items from the loot container.

 

If I'm right, you could write a buff like this, and add it to the player when they spawn or respawn:

 

<buff name="buffGodModeWhenInContainer" name_key="buffGodModeName" description_key="buffGodModeDesc" tooltip_key="buffGodModeTooltip" icon="ui_game_symbol_add" icon_color="132,0,155">
    <stack_type value="ignore" />
    <display_value_key value="buffGodModeNameShort" />
    <display_value value="xxx" />

    <effect_group>
        <triggered_effect trigger="onSelfOpenLootContainer" action="AddBuff" buff="god" />
        <triggered_effect trigger="onSelfLootContainer" action="RemoveBuff" buff="god" />
    </effect_group>
</buff>

 

(As you might tell, I based it off of the vanilla "god mode" buff.)

 

That's just a suggestion, but it should hopefully be enough to point you in the right direction.

 

Also, a caveat: Those triggered effects are not actually used in any vanilla buffs. The comments don't have the "hook up" phrase that means they still have to be hooked up, so I assume they're hooked up and working, and just unused. But that is my assumption. You'll have to try it yourself.

 

EDIT: Also, if "onSelfLootContainer" is not fired when the container is closed, then you will have to figure out some other way to remove the "god" buff (or its effects). Maybe make the "update_rate" value be "2" (seconds) and have the "god" buff removed "onSelfBuffUpdate". 

Edited by khzmusik (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...