Skip to content

Fix/clock beasthelmet kingmakers crown magicresist herobuffs#2020

Open
Sapphire2408 wants to merge 147 commits intowindy10v10ai:developfrom
Sapphire2408:fix/clock_beasthelmet_kingmakers_crown_magicresist_herobuffs
Open

Fix/clock beasthelmet kingmakers crown magicresist herobuffs#2020
Sapphire2408 wants to merge 147 commits intowindy10v10ai:developfrom
Sapphire2408:fix/clock_beasthelmet_kingmakers_crown_magicresist_herobuffs

Conversation

@Sapphire2408
Copy link
Copy Markdown

Issue

  • fix #9999

Checklist

  • I have tested the changes works well.

Release Note

[b]游戏性更新 v5.00a[/b]

- 修正一些bug和平衡性改动。
[b]Gameplay update v5.00a[/b]

- Fixed some bugs and balance.

windybirth and others added 30 commits July 28, 2023 09:49
v2.23 add tower ability, fix bug about 7.34
v2.24 time limit enhance, item enhance
v2.28 end 3rd season, time limit enhance.
v2.29 end time limit, enhance Jack ability, lifesteal
* v3.03

* revert N6 time limit enhance

* Revert "限时强化 (windy10v10ai#707)"

This reverts commit 8e73e02.

* fix windy10v10ai#718 血精石

* Update npc_items_custom.txt

* fix abilities with 7.35

* Create bug templates

* Create FUNDING.yml

* Update FUNDING.yml (windy10v10ai#723)

* Update FUNDING.yml

* Update issue templates (windy10v10ai#724)

* Create create_pr.yml

* Update create_pr.yml

* Update pull_request_template.md

* Revert "Update pull_request_template.md"

This reverts commit afe18f1.

* 中立物品数值调整和抽奖物品调整 (windy10v10ai#719)

* 中立物品等级

* 代码位置顺序

* 中立数值

* fix

* fix

* 调整

* Update npc_abilities_override.txt

---------

Co-authored-by: windy <windybirth@gmail.com>

* Update feature/725-update-7.35-abilities (windy10v10ai#726)

* Update Ability: Leshrac 拉席克/老鹿

* Update create_pr.yml

* Update create_pr.yml

* Update create_pr.yml

* Update create_pr.yml

* Update create_pr.yml

* Update create_pr.yml

* Update create_pr.yml

* Update create_pr.yml

* Update create_pr.yml

* Update create_pr.yml

* Update create_pr.yml

* Update create_pr.yml

* Update create_pr.yml

* Update create_pr.yml

* Update create_pr.yml

* Update create_pr.yml

* Update create_pr.yml

* Update create_pr.yml

* Update create_pr.yml

* Update create_pr.yml

* Update create_pr.yml

* Update create_pr.yml

* Update npc_abilities_override.txt

* Update npc_abilities_override.txt

---------

Co-authored-by: windy <windybirth@gmail.com>

* fix bug

* balance

* fix text

---------

Co-authored-by: 76years-old-reliable-man <111288032+76years-old-reliable-man@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
v3.04 New item Cursed Rapier, Release Sword Master, balance item.
v3.05 Skill point player property, update ts framework
v3.06 Fix AI ability build, fix incoming damage bug
v3.09a Optimize AI tower push action.
v3.11 Strength roshan, drop gold bag.
Copilot AI review requested due to automatic review settings April 14, 2026 14:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR targets the v5.00a gameplay update by changing the intellect-based magic resistance scaling, adding new high-tier items (Kingmaker’s Crown, Beast Helmet) with supporting KV/shop/localization/assets, and applying a broad set of balance tweaks via ability overrides.

Changes:

  • Replaced the intellect→magic-resist calculation with a capped diminishing-returns function and updated its tests.
  • Added new item implementations/definitions (Kingmaker’s Crown, Beast Helmet) plus shop entries, localization, and UI assets.
  • Updated multiple KV files for balance (item/ability values and overrides).

Reviewed changes

Copilot reviewed 14 out of 22 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
src/vscripts/modifiers/global/intellect-magic-resist-calculator.ts New hyperbolic diminishing-returns MR formula (now capped).
src/vscripts/modifiers/global/intelect_magic_resist.test.ts Updated test vectors and assertions for new MR curve.
src/vscripts/items/ts_items/item_kingmakers_crown.ts New item script: stats + Vlad-style aura + global lane-creep inheritance aura.
src/vscripts/items/ts_items/item_beast_helmet.ts New item script: active “BKB-like” state + pure damage conversion + int-scaling spell amp.
game/scripts/shops.txt Adds new items to shop lists.
game/scripts/npc/npc_items_custom.txt Adds/edits item KVs (incl. new recipes/items).
game/scripts/npc/npc_items_artifact.txt Adds Kingmaker’s Crown KVs; file encoding appears altered.
game/scripts/npc/npc_abilities_override.txt Large balance overrides; contains a KV syntax error in the diff.
game/resource/addon_schinese.txt Adds localized tooltips for new items/modifiers.
game/resource/addon_english.txt Adds localized tooltips but duplicates the same key blocks.
game/resource/flash3/images/items/*.png New item icons (Flash UI).
content/panorama/images/items/*.png / *.xml New panorama icons + loader XMLs for new items/recipes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +24 to +40
OnCreated(): void {
if (IsServer()) {
// Add the global aura emitter
this.GetCaster()?.AddNewModifier(
this.GetCaster(),
this.GetAbility(),
'modifier_item_kingmakers_crown_global_emitter',
{},
);
}
}

OnDestroy(): void {
if (IsServer()) {
this.GetCaster()?.RemoveModifierByName('modifier_item_kingmakers_crown_global_emitter');
}
}
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ModifierItemKingmakersCrown overrides OnCreated/OnDestroy but doesn’t call super.OnCreated() / super.OnDestroy(). BaseItemModifier explicitly requires this to keep the datadriven stats modifier in sync; even if statsModifierName is currently empty, this is easy to break later. Please call the base implementations when overriding.

Copilot uses AI. Check for mistakes.
Comment on lines +114 to +121
DeclareFunctions(): ModifierFunction[] {
return [
ModifierFunction.MAGICAL_RESISTANCE_BONUS,
ModifierFunction.PHYSICAL_ARMOR_BONUS,
ModifierFunction.TOTALDAMAGEOUTGOING_PERCENTAGE,
ModifierFunction.STATUS_RESISTANCE,
];
}
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modifier_item_beast_helmet_active advertises %damage_reduction_pct%%% Damage Reduction (and the KV defines damage_reduction_pct), but the modifier never applies any incoming damage reduction property (e.g. INCOMING_DAMAGE_PERCENTAGE). This makes the active significantly weaker/different than described. Add the appropriate declared function and return a negative percentage based on damage_reduction_pct.

Copilot uses AI. Check for mistakes.
"images_take_damage_percent"
{
"value" "100" // 175
"value" "0 // 175
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This KeyValues entry is syntactically invalid (missing closing quote) and will break parsing of npc_abilities_override.txt:
"value" "0 // 175
It should be a properly quoted value (and comment) like the surrounding entries.

Suggested change
"value" "0 // 175
"value" "0" // 175

Copilot uses AI. Check for mistakes.
Comment thread game/scripts/npc/npc_items_custom.txt Outdated
Comment on lines +7536 to +7572
"item_recipe_chimeras_leash"
{
"BaseClass" "item_recipe_arcane_boots"
"ID" "11102"
"Model" "models/props_gameplay/recipe.vmdl"
"AbilityTextureName" "item_recipe_chimeras_leash"
"ItemCost" "0"
"ItemRecipe" "1"
"ItemResult" "item_chimeras_leash"
"ItemRequirements"
{
"01" "item_manta;item_light_part;item_fusion_forbidden"
}
}

"item_chimeras_leash"
{
"BaseClass" "item_lua"
"ID" "11103"
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_PASSIVE"
"AbilityTextureName" "item_chimeras_leash"
"ScriptFile" "items/ts_items/item_chimeras_leash"
"ItemCost" "25000"
"ItemShopTags" "armor;attack_speed;damage;hard_to_tag"
"ItemQuality" "artifact"
"ItemAliases" "chimera;leash;chimeras"
"ItemDeclarations" "DECLARE_PURCHASES_TO_TEAMMATES | DECLARE_PURCHASES_IN_SPEECH | DECLARE_PURCHASES_TO_SPECTATORS"

"AbilityValues"
{
"bonus_all_stats" "30"
"bonus_health" "500"
"bonus_mana" "500"
"aura_radius" "-1"
}
}

Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

item_chimeras_leash is added to the shop and defined as an item_lua with ScriptFile set to items/ts_items/item_chimeras_leash, but there is no corresponding implementation under src/vscripts/items/ts_items/. This will fail to load at runtime. Add the missing script (and intrinsic modifier) or remove/disable the item definition until it exists.

Suggested change
"item_recipe_chimeras_leash"
{
"BaseClass" "item_recipe_arcane_boots"
"ID" "11102"
"Model" "models/props_gameplay/recipe.vmdl"
"AbilityTextureName" "item_recipe_chimeras_leash"
"ItemCost" "0"
"ItemRecipe" "1"
"ItemResult" "item_chimeras_leash"
"ItemRequirements"
{
"01" "item_manta;item_light_part;item_fusion_forbidden"
}
}
"item_chimeras_leash"
{
"BaseClass" "item_lua"
"ID" "11103"
"AbilityBehavior" "DOTA_ABILITY_BEHAVIOR_PASSIVE"
"AbilityTextureName" "item_chimeras_leash"
"ScriptFile" "items/ts_items/item_chimeras_leash"
"ItemCost" "25000"
"ItemShopTags" "armor;attack_speed;damage;hard_to_tag"
"ItemQuality" "artifact"
"ItemAliases" "chimera;leash;chimeras"
"ItemDeclarations" "DECLARE_PURCHASES_TO_TEAMMATES | DECLARE_PURCHASES_IN_SPEECH | DECLARE_PURCHASES_TO_SPECTATORS"
"AbilityValues"
{
"bonus_all_stats" "30"
"bonus_health" "500"
"bonus_mana" "500"
"aura_radius" "-1"
}
}
// Disabled: item_chimeras_leash is defined as item_lua, but its ScriptFile
// (items/ts_items/item_chimeras_leash) does not exist in the current codebase.
// Re-enable this recipe and item only after the corresponding script and
// intrinsic modifier have been implemented.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to 6
"DOTAAbilities"
{

//=================================================================================================================
// 龙珠系列 dragon ball blessing of dragon
// 龙珠系列 dragon ball blessing of dragon
//=================================================================================================================
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npc_items_artifact.txt appears to have been re-saved with a BOM / wrong encoding: the file now starts with a BOM character and multiple Chinese comments are garbled (mojibake). This makes future edits difficult and can cause tooling/parsing issues in some environments. Please restore UTF-8 encoding (preferably without BOM) and ensure comments remain readable.

Copilot uses AI. Check for mistakes.
}

OnCreated(): void {
if (IsServer()) {
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ModifierItemKingmakersCrownGlobalAura.OnCreated starts interval thinking but never computes initial stackCount/amp* values immediately, so lane creeps will have 0 inherited stats for up to 1 second after the modifier is applied. Consider calling this.OnIntervalThink() once inside OnCreated (server-side) before starting the interval.

Suggested change
if (IsServer()) {
if (IsServer()) {
this.OnIntervalThink();

Copilot uses AI. Check for mistakes.
Comment on lines +287 to +289
// Reduction Amp
const scalingReduction = buffAbility.GetSpecialValueFor('damage_reduction');
this.ampReduction = scalingReduction * 0.1;
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tooltip/localization claims the global aura grants a flat "10% Damage Reduction", but the implementation sets ampReduction as scalingReduction * 0.1 (i.e. only 10% of the existing time-scaling reduction, and it depends on the creep buff level). Either update the implementation to match the described flat reduction, or adjust the tooltip/comment so players aren’t misled.

Suggested change
// Reduction Amp
const scalingReduction = buffAbility.GetSpecialValueFor('damage_reduction');
this.ampReduction = scalingReduction * 0.1;
// Flat 10% damage reduction to match the aura description.
this.ampReduction = -10;

Copilot uses AI. Check for mistakes.
export class modifier_item_beast_helmet_active extends BaseItemModifier {
protected override statsModifierName: string = '';
private isApplyingPureDamage: boolean = false;

Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modifier_item_beast_helmet_active extends BaseItemModifier, whose default attributes include MODIFIER_ATTRIBUTE_MULTIPLE. For an active buff this can allow multiple concurrent instances (e.g. via refresh mechanics), which is usually unintended for BKB-like effects. Consider extending BaseModifier instead, or overriding GetAttributes() to remove MULTIPLE.

Suggested change
GetAttributes(): ModifierAttribute {
return ModifierAttribute.NONE;
}

Copilot uses AI. Check for mistakes.
Comment on lines +2979 to +3032
"DOTA_Tooltip_Ability_item_kingmakers_crown" "The Kingmaker's Crown"
"DOTA_Tooltip_Ability_item_kingmakers_crown_Description" "<h1>Passive: Vladimir's Aura</h1>Grants lifesteal, armor, mana regeneration, and attack speed to all nearby allies (1200 radius).<br><h1>Passive: Kingmaker's Inheritance</h1>Projects a global aura. Every allied lane creep gains %stat_inheritance_percent%%% of your Maximum HP and %stat_inheritance_percent%%% of your Total Attack Damage. Also grants +50%% Magic Resistance, 10% Damage Reduction and amplifies Time-Scaling bonuses by 30%%."
"DOTA_Tooltip_Ability_item_kingmakers_crown_Lore" "Inject your farmed power directly into the minion waves. Be everywhere at once."
"DOTA_Tooltip_Ability_item_kingmakers_crown_bonus_all_stats" "+$all"
"DOTA_Tooltip_Ability_item_kingmakers_crown_bonus_armor" "+$armor"
"DOTA_Tooltip_Ability_item_kingmakers_crown_bonus_attack_speed" "+$attack"
"DOTA_Tooltip_Ability_item_kingmakers_crown_bonus_damage" "+$damage"
"DOTA_Tooltip_Ability_item_kingmakers_crown_aura_armor" "AURA BONUS ARMOR:"
"DOTA_Tooltip_Ability_item_kingmakers_crown_aura_negative_armor" "AURA ARMOR REDUCTION:"
"DOTA_Tooltip_Ability_item_kingmakers_crown_aura_attack_speed" "AURA BONUS ATTACK SPEED:"
"DOTA_Tooltip_Ability_item_kingmakers_crown_vampiric_aura" "%%LIFESTEAL AURA:"
"DOTA_Tooltip_Ability_item_kingmakers_crown_damage_aura" "%%BONUS DAMAGE AURA:"
"DOTA_Tooltip_Ability_item_kingmakers_crown_mana_regen_aura" "AURA MANA REGEN:"
"DOTA_Tooltip_Ability_item_kingmakers_crown_stat_inheritance_percent" "%%STAT INHERITANCE:"

"DOTA_Tooltip_modifier_item_kingmakers_crown_vlad_aura" "Vladimir's Aura"
"DOTA_Tooltip_modifier_item_kingmakers_crown_vlad_aura_Description" "Bonus Armor, Lifesteal, Attack Speed, and Mana Regen."
"DOTA_Tooltip_modifier_item_kingmakers_crown_global_aura" "Kingmaker's Inheritance"
"DOTA_Tooltip_modifier_item_kingmakers_crown_global_aura_Description" "Inheriting health and damage from the Kingmaker."
"DOTA_Tooltip_Ability_item_beast_helmet" "Beast Helmet"
"DOTA_Tooltip_Ability_item_beast_helmet_Description" "<h1>Active: Primal Surge</h1>Grants Spell Immunity, 100%% Magic Resistance, 100%% Status Resistance and %damage_reduction_pct%%% Damage Reduction for %active_duration% seconds. During this period, all outgoing damage from attacks and spells is converted to Pure damage.\n<h1>Passive: Intelligence Scaling</h1>Passively grants %spell_amp_per_int%%% Spell Amplification per point of Intelligence."
"DOTA_Tooltip_Ability_item_beast_helmet_Lore" "The ultimate offensive artifact forged from the essence of beast runes, turning the wearer's every strike into a pure, unstoppable force."
"DOTA_Tooltip_Ability_item_beast_helmet_bonus_strength" "+$str"
"DOTA_Tooltip_Ability_item_beast_helmet_bonus_intellect" "+$int"
"DOTA_Tooltip_modifier_item_beast_helmet_active" "Primal Surge"
"DOTA_Tooltip_modifier_item_beast_helmet_active_Description" "Magic immune, 80%% damage reduction, and all damage is converted to Pure damage."


"DOTA_Tooltip_Ability_item_kingmakers_crown" "The Kingmaker's Crown"
"DOTA_Tooltip_Ability_item_kingmakers_crown_Description" "<h1>Passive: Vladimir's Aura</h1>Grants lifesteal, armor, mana regeneration, and attack speed to all nearby allies (1200 radius).<br><h1>Passive: Kingmaker's Inheritance</h1>Projects a global aura. Every allied lane creep gains %stat_inheritance_percent%%% of your Maximum HP and %stat_inheritance_percent%%% of your Total Attack Damage. Also grants +50%% Magic Resistance, 10% Damage Reduction and amplifies Time-Scaling bonuses by 30%%."
"DOTA_Tooltip_Ability_item_kingmakers_crown_Lore" "Inject your farmed power directly into the minion waves. Be everywhere at once."
"DOTA_Tooltip_Ability_item_kingmakers_crown_bonus_all_stats" "+$all"
"DOTA_Tooltip_Ability_item_kingmakers_crown_bonus_armor" "+$armor"
"DOTA_Tooltip_Ability_item_kingmakers_crown_bonus_attack_speed" "+$attack"
"DOTA_Tooltip_Ability_item_kingmakers_crown_bonus_damage" "+$damage"
"DOTA_Tooltip_Ability_item_kingmakers_crown_aura_armor" "AURA BONUS ARMOR:"
"DOTA_Tooltip_Ability_item_kingmakers_crown_aura_negative_armor" "AURA ARMOR REDUCTION:"
"DOTA_Tooltip_Ability_item_kingmakers_crown_aura_attack_speed" "AURA BONUS ATTACK SPEED:"
"DOTA_Tooltip_Ability_item_kingmakers_crown_vampiric_aura" "%%LIFESTEAL AURA:"
"DOTA_Tooltip_Ability_item_kingmakers_crown_damage_aura" "%%BONUS DAMAGE AURA:"
"DOTA_Tooltip_Ability_item_kingmakers_crown_mana_regen_aura" "AURA MANA REGEN:"
"DOTA_Tooltip_Ability_item_kingmakers_crown_stat_inheritance_percent" "%%STAT INHERITANCE:"

"DOTA_Tooltip_modifier_item_kingmakers_crown_vlad_aura" "Vladimir's Aura"
"DOTA_Tooltip_modifier_item_kingmakers_crown_vlad_aura_Description" "Bonus Armor, Lifesteal, Attack Speed, and Mana Regen."
"DOTA_Tooltip_modifier_item_kingmakers_crown_global_aura" "Kingmaker's Inheritance"
"DOTA_Tooltip_modifier_item_kingmakers_crown_global_aura_Description" "Inheriting health and damage from the Kingmaker."
"DOTA_Tooltip_Ability_item_beast_helmet" "Beast Helmet"
"DOTA_Tooltip_Ability_item_beast_helmet_Description" "<h1>Active: Primal Surge</h1>Grants Spell Immunity, 100%% Magic Resistance, 100%% Status Resistance and %damage_reduction_pct%%% Damage Reduction for %active_duration% seconds. During this period, all outgoing damage from attacks and spells is converted to Pure damage.\n<h1>Passive: Intelligence Scaling</h1>Passively grants %spell_amp_per_int%%% Spell Amplification per point of Intelligence."
"DOTA_Tooltip_Ability_item_beast_helmet_Lore" "The ultimate offensive artifact forged from the essence of beast runes, turning the wearer's every strike into a pure, unstoppable force."
"DOTA_Tooltip_Ability_item_beast_helmet_bonus_strength" "+$str"
"DOTA_Tooltip_Ability_item_beast_helmet_bonus_intellect" "+$int"
"DOTA_Tooltip_modifier_item_beast_helmet_active" "Primal Surge"
"DOTA_Tooltip_modifier_item_beast_helmet_active_Description" "Magic immune, 80%% damage reduction, and all damage is converted to Pure damage."
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addon_english.txt contains duplicate tooltip key blocks for Kingmaker’s Crown and Beast Helmet (the same keys are defined twice), and the first occurrence at line 2979 is also mis-indented compared to surrounding entries. Duplicate keys can lead to hard-to-debug overrides; please remove the duplicated block and keep a single canonical definition per key.

Copilot uses AI. Check for mistakes.
Comment on lines +11 to +12

return maxCap * ((c * intellect) / (1 + c * intellect));
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new hyperbolic formula has a singularity when 1 + c * intellect approaches 0 (e.g. intellect = -1000 when c=0.001), which can produce Infinity/NaN and propagate into magical resistance calculations. Consider clamping intellect to a safe minimum (e.g. Math.max(intellect, 0)) or guarding against 1 + c*intellect <= 0 before dividing.

Suggested change
return maxCap * ((c * intellect) / (1 + c * intellect));
const safeIntellect = Math.max(intellect, 0);
return maxCap * ((c * safeIntellect) / (1 + c * safeIntellect));

Copilot uses AI. Check for mistakes.
@Sapphire2408
Copy link
Copy Markdown
Author

@copilot resolve the merge conflicts in this pull request, use all kv from this pr, add incoming non existing ones

@Sapphire2408
Copy link
Copy Markdown
Author

@copilot resolve the merge conflicts in this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants