Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(content): only call ~player_combat_stat on stat change and equipment change #1397

Merged
merged 1 commit into from
Mar 3, 2025

Conversation

tannerdino
Copy link
Collaborator

image

Fairly certain they only need to be calculated on stat change and equipment change. I think there were also some osrs bugs related to this at some point with new weaponry?

Should also help with server tick speed :)

@tannerdino
Copy link
Collaborator Author

tannerdino commented Mar 3, 2025

I noticed something that may be an issue.

def_int $damage = 0;
if (~player_npc_hit_roll(%damagetype) = true) {
if (npc_type = count_draynor & inv_total(inv, garlic) > 0) {
%com_maxhit = add(%com_maxhit, 1);
}
if (npc_param(demonbane_vulnerable) = true & inv_total(worn, silverlight) > 0) {
%com_maxhit = divide(multiply(%com_maxhit, 160), 100);
}

Maxhit could exponentially increase if you never equip something or regenerate a stat. Maybe %com_maxhit is recalculated every hit. Perhaps %com_maxhit doesn't even exist? Is there a source for this?

@tannerdino tannerdino marked this pull request as draft March 3, 2025 03:04
@tannerdino
Copy link
Collaborator Author

I noticed something that may be an issue.

def_int $damage = 0;
if (~player_npc_hit_roll(%damagetype) = true) {
if (npc_type = count_draynor & inv_total(inv, garlic) > 0) {
%com_maxhit = add(%com_maxhit, 1);
}
if (npc_param(demonbane_vulnerable) = true & inv_total(worn, silverlight) > 0) {
%com_maxhit = divide(multiply(%com_maxhit, 160), 100);
}

Maxhit could exponentially increase if you never equip something or regenerate a stat. Maybe %com_maxhit is recalculated every hit. Perhaps %com_maxhit doesn't even exist? Is there a source for this?

On second thought, perhaps a more simple answer is to just use a local variable or %int

@tannerdino tannerdino marked this pull request as ready for review March 3, 2025 03:42
@Pazaz Pazaz merged commit d6deba4 into 2004Scape:main Mar 3, 2025
3 checks passed
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.

2 participants