#How should the last table parameter be configured for the AddNewModifier function?

1 messages · Page 1 of 1 (latest)

woeful dome
#

OnProjectileHit(target: CDOTA_BaseNPC, location: Vector): boolean | void {
print('test_ability OnProjectileHit target Name ' + target.GetName());

    let damage: ApplyDamageOptions = {
        ability: this,
        attacker: this.GetCaster(),
        damage: 200,
        damage_flags: DamageFlag.HPLOSS,
        damage_type: DamageTypes.MAGICAL,
        victim: target,
    };

    ApplyDamage(damage);

    target.AddNewModifier(this.GetCaster(), this, 'testmodifier', { duration: 1.0 });
}

The above is a segment of code from my ability class. I want to apply a modifier to the target object, so I used the AddNewModifier method. The last parameter of this method is a table object, and currently, I know that 'duration' is effective. Is this considered a default parameter? If so, what are the other default parameters? Can custom parameters be specified here?

oblique jewel
#

duration is the only parameter that does anything on its own.
You can put any primitive key value pairs you want in the table and they will be sent to the modifiers OnCreated or OnRefresh functions.

rocky vale
#

You can put any primitive key value pairs you want in the table and they will be sent to the modifiers OnCreated or OnRefresh functions.

But only on the server side of them - this is important as OnCreated and OnRefresh trigger on the clientside as well!

runic socket
#

Luckily custom transmitters made this significantly more useful