Comments (6)
Similar fix with stam/hits/mana
#625
from source-x.
It's not a similar fix, the difference is that modstats can go below 0 while the related stats no.
This bring the following issue:
ON=@equip
src.modstr -50
ON=@Unequip
src.modtr 50
Currently a character with 40 str equipping this item will go below 0 and thus it will get a 65k value of str.
If we internally add a check that avoid a mod value to bring the main stat below 0, the player Unequipping the item will get a 50 str value instead of his original 40 value.
That's because, unlike spells stat modifier, modStats modifier are not tracked anywhere.
So the best solution for me is that the scripter is responsible to check if a modStat will bring the stat below 0. (It's a simple script)
Example:
//Argn1: ModStr value
[FUNCTION setModStr]
if (<tag0.override.modstr>)
modstr -= <tag0.override.modstr>
tag.override.modstr =
return
endif
if ((<str> + <argn1>) < 0)
argn1 = -<str>
tag.override.modstr += <argn1>
sysmessage @50 Modstr overrided to <argn1>
endif
modstr <argn1>
from source-x.
Seem legit to me. Tag.override.modstr wiil be a custom modstr only in script side?
from source-x.
yes
from source-x.
on=@statchange
if <argn1> <= 2 //if str dex or int
if <argn3> <= 0 //if new value will be negative or 0
argn3=1
endif
endif
I think this or something like this is the best way to fix it.
When items get unequiped, str will be reset as modstr + ostr, so no need to store anything at any tag.
I think this simple check could be added to source. The question would be the limit. 0 or 1?
from source-x.
That should be double checked, then if there's still overflow, the wisest thing would be only to limit the stat to 0 before overflowing
from source-x.
Related Issues (20)
- Old fork of the sphere with features HOT 3
- region.tag (t_multi) HOT 5
- Monsters do not use some skills
- Spellbook Spells behaviour (OLD vs OSI) (Feature Request) HOT 1
- Debug and t_multi (custom?) HOT 4
- t_multi_custom remove HOT 3
- Vendor (Item without Value) HOT 9
- Feature Request: TIMERFD HOT 6
- TEVENTS not being saved on the item HOT 12
- COMP (Gets the number of components) HOT 5
- T_Multi_Addons Position
- ADDCOMP, DELCOMP HOT 8
- ISSTUCK HOT 15
- CAN_I_SCRIPTEDMORE
- PLEVEL commands not working on GM account HOT 1
- Problems with Curse Weapon magic in i_magic_necromancer
- Problems with pain_spike magic in i_magic_necromancer
- ISVALID female gump HOT 7
- LIST and math HOT 1
- can_i_damageable and ItemHitpointsUpdate, do not update status
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from source-x.