8000 NRD_CharacterSetPermanentBoostInt does not apply properly when used with statuses · Issue #143 · Norbyte/ositools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

NRD_CharacterSetPermanentBoostInt does not apply properly when used with statuses #143

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 comm 8000 unity.

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

Open
Anacroniqa opened this issue Aug 24, 2024 · 0 comments
Labels
bug Something isn't working scripting Extender scripting API issue (mod developers)

Comments

@Anacroniqa
Copy link
Anacroniqa commented Aug 24, 2024

Extender Version

v59

Game Version

v3.6.117.3735

Bug Summary

First of all, this is the first time I report a bug of this type and I have zero formation in programming, so sorry if I don't give all the needed information. The issue is related to the NRD_CharacterSetPermanentBoostInt((CHARACTERGUID)_Character, (STRING)_Stat, (INTEGER)_Value) call. I am using it to give boosts to armor and magic armor from Finesse/Strength and Intelligence and it works perfectly in most instances, except for when those stats are modified by statuses. When a status is applied, the bonus registers correctly in the character sheet and the maximum quantity of magic armor/armor you are supposed to be able to have increases accordingly. However, the actual quantity of armor/magic armor (what would be the CurrentArmor/CurrentMagicArmor stats) do not increase and cannot be filled either. It only fills once another status is applied. I found a workaround to make things work by having a "sincronizing" status applied each time a status is applied, but I thought I should report the issue regardless. I leave here a sample of the code in case it is useful.

IF CharacterStatusApplied(_Character, _StatusId, _Causee) AND DB_IsPlayer(_Character) AND NRD_StatusGetHandle((CHARACTERGUID)_Character, _StatusId, _StatusHandle) AND NRD_StatusGetReal((CHARACTERGUID)_Character, _StatusHandle, "CurrentLifeTime", _CurrentLifeTime) AND NRD_StatusGetReal((CHARACTERGUID)_Character, _StatusHandle, "LifeTime", _LifeTime) AND _CurrentLifeTime == _Lifetime AND NRD_CharacterGetComputedStat(_Character, "Strength", 0, _SValue) AND NRD_CharacterGetComputedStat(_Character, "Finesse", 0, _FValue) AND NRD_CharacterGetComputedStat(_Character, "Intelligence", 0, _IValue) AND _FValue > _SValue AND IntegerSubtract(_FValue, 4, _ArmorValue) AND IntegerSubtract(_IValue, 4, _MagicArmorValue) THEN NRD_CharacterSetPermanentBoostInt(_Character, "Armor", _ArmorValue); NRD_CharacterSetPermanentBoostInt(_Character, "MagicArmor", _MagicArmorValue); CharacterAddAttribute(_Character, "Dummy", 0);

I iterated that a lot trying to find what the issue was, so I can tell there is no difference between using the NRD_CharacterGetComputedStat or the CharacterGetAttribute query, nor between using the CharacterStatusApplied or the NRD_StatusIteratorEvent. It doesn't make any difference if you give more or less conditions either.

This is the code for the workaround. The sincronize status needs to modify a stat, It cannot give, for example, 0 Intelligence. Any modification, from resistances, to attributes seem to work for the armor/magic armor values to update properly: not only what would be the MaxArmor / MaxMagicArmor increases, the CurrentArmor/CurrentMagicArmor does so accordingly.

IF NRD_StatusIteratorEvent(_Event, (CHARACTERGUID)_Character, _StatusId, _StatusHandle) AND DB_IsPlayer(_Character) AND _StatusId != "AMS_Sincronize" AND NRD_StatusGetReal((CHARACTERGUID)_Character, _StatusHandle, "CurrentLifeTime", _CurrentLifeTime) AND NRD_StatusGetReal((CHARACTERGUID)_Character, _StatusHandle, "LifeTime", _LifeTime) AND RealSubtract(_LifeTime, _CurrentLifeTime, _TiempoAplicado) AND _TiempoAplicado == 5.0 THEN ApplyStatus((CHARACTERGUID)_Character, "AMS_Sincronize", 0.0,1);

Links

No response

@Anacroniqa Anacroniqa added bug Something isn't working scripting Extender scripting API issue (mod developers) labels Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working scripting Extender scripting API issue (mod developers)
Projects
None yet
Development

No branches or pull requests

1 participant
0