Applying Data Driven Modifiers from script
Jump to navigation
Jump to search

This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)

This article needs more
links to other articles to help
integrate it into the encyclopedia. Please help improve this article by adding links
that are relevant to the context within the existing text.
January 2024



January 2024

This article is an orphan, meaning that few or no articles link to it.
You can help by
adding links to this article from other relevant articles.
January 2024
You can help by

January 2024
It's possible to freely apply custom data-driven modifiers from VScript using the following function.
CDOTA_Item_DataDriven
Function | Signature | Description |
---|---|---|
ApplyDataDrivenModifier | void ApplyDataDrivenModifier(handle source, handle target, string modifier_name, handle modifierArgs)
|
Hopefully you've noticed this function belongs to objects of the Item type. It's used along with a data-driven item definition containing your data-driven modifiers.
"item_modifier_master"
{
"ID" "1010"
// General
//-------------------------------------------------------------------------------------------------------------
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_NO_TARGET | DOTA_ABILITY_BEHAVIOR_IMMEDIATE"
"BaseClass" "item_datadriven"
// Stats
//-------------------------------------------------------------------------------------------------------------
"AbilityCastRange" "100"
"AbilityCastPoint" "0.0"
// Item Info
//-------------------------------------------------------------------------------------------------------------
"Modifiers"
{
"modifier_custom"
{
"TextureName" "item_greater_salve"
"EffectName" "particles/items_fx/healing_flask.vpcf"
"EffectAttachType" "follow_origin"
"Properties"
{
"MODIFIER_PROPERTY_ATTACKSPEED_BONUS_CONSTANT" "100"
}
}
}
}
And the script:
local ModMaster = CreateItem("item_modifier_master", nil, nil)
ModMaster:ApplyDataDrivenModifier(unit, unit, "modifier_custom", {duration = 3})

This article has not been added to any content
categories. Please help out by
adding categories.
January 2024


January 2024