numbers not being sent correctly...

Need help with your JScripts? Got questions concerning the DFNs? Come forward, step inside :)
Post Reply
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

numbers not being sent correctly...

Post by stranf »

This one is going to be hard to reproduce, and I'm not even sure where to start looking for the book.

Here is the scenario:

1. my GM creates sandals_wanderer from by magic1.js (they should increase dex by 1)

He puts them on and takes them off. Sure enough script works perfectly.

2. my PC puts them on and loses 3 dex., takes them off and loses 5 dex.

3. my PC is puzzled and gives them to a friend on another client. He puts them on, dex changes to 6554, he takes them off, it is reduces to 655. But he is still "too fatigued to move"

4. My GM is puzzled, runs back to the sandals, puts them on. dex increase by 1. and is reduced by 1.

The script like is

Code: Select all

mchar.dexterity = (mchar.dexterity + 1)

My only idea is, is that both my PC and my friend were wearing armor that reduced the dexterity orginially. Could there be an issue on how UOx3 adjusts dexterity modifiers while wearing armor? The GM was not wearing armor, and the script seemed to work fine on him.[/code]
Maarc
Developer
Posts: 576
Joined: Sat Mar 27, 2004 6:22 am
Location: Fleet, UK
Has thanked: 0
Been thanked: 0
Contact:

Post by Maarc »

I have an idea on why this might be. You're actually modifying the strength/dexterity/intelligence values directly. Because of this, they become subject to the normal stat capping system. Which means that skill/stat gain would attempt to compensate for this.

What you want to do is alter a different value. Instead of

Code: Select all

mchar.dexterity = mchar.dexterity + 1;
Use this:

Code: Select all

mchar.tempdex = mchar.tempdex + 1;
We have a tempdex, tempint and tempstr value. And this should *not* be affected by the actual stat/skill capping code, but in all things (like skill checks and so forth), includes the bonus, basically.

Mind you, you might want to be aware of this in your JS scripts, wherever you rely on intelligence/dex/str. The dexterity/strength/intelligence property that we expose to you includes these bonuses as well. So if you wanted the real stat value, you'd have to do

Code: Select all

var charRealDex = mchar.dexterity + mchar.tempdex;
Hopefully this will help you.
Post Reply