weapon speed

Need help with your JScripts? Got questions concerning the DFNs? Come forward, step inside :)
Post Reply
phao
UOX3 Newbie
Posts: 24
Joined: Sat Aug 11, 2007 7:27 pm
Has thanked: 0
Been thanked: 0

weapon speed

Post by phao »

how can i chance the weapon speed by script?
like

item.speed = X;

i've not found something like that in the JavaScriptDocs but i've seen some speed thing on the dfn files.

i want some dinamyc thing, so i cannot use the dfn in this case.
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

Some DFN values are not exported to scripts yet. Off the top of my head, are stradd, dexadd, etc. It would be nice if we came up with a list of values on DFNs that are not yet supported by JS objects and see if we can get most, if not all, of them exported.

The problem is, I'm not exactly sure what process -or how difficult- it is to do such a thing.

I'm also wondering if there is a way to control the "weapon speed" of a monster...it seems to me they all attack at the same rate.
phao
UOX3 Newbie
Posts: 24
Joined: Sat Aug 11, 2007 7:27 pm
Has thanked: 0
Been thanked: 0

Post by phao »

i want to do that because it seems that when you equip a weapon the damage that you'll cause is the weapon damage (ignoring your str), and i've changed it (by changing the weapon damage when you equip it modifying it based on your str, and when unequiped back to the 'old' damage).

and i need to do the same with speed.
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post by Grimson »

stranf wrote:The problem is, I'm not exactly sure what process -or how difficult- it is to do such a thing.
It's not very difficult, but the JS engine has a limit on the amount of properties a class can have. And as you can already use the onEquip and onUnequip events as a way to add bonus stats to a char I see no big need to export stradd, dexadd an so on.
stranf wrote:I'm also wondering if there is a way to control the "weapon speed" of a monster...it seems to me they all attack at the same rate.
The attack speed of chars is based on the dexterity (value is capped at 100) and, if they have an actual weapon equiped (not just a weapon on the model) the weapon speed. If they don't have a weapon the wrestling skill is used instead.
phao
UOX3 Newbie
Posts: 24
Joined: Sat Aug 11, 2007 7:27 pm
Has thanked: 0
Been thanked: 0

Post by phao »

yes, i've noticed here that the speed is increased until some value, but in my server it'll have players with 180 dex.

so i have to 'ignore' that cap.
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post by Grimson »

phao wrote:yes, i've noticed here that the speed is increased until some value, but in my server it'll have players with 180 dex.

so i have to 'ignore' that cap.
Then you'll have to change the code in combat.cpp and build UOX3 yourself.
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

The attack speed of chars is based on the dexterity (value is capped at 100) and, if they have an actual weapon equiped (not just a weapon on the model) the weapon speed. If they don't have a weapon the wrestling skill is used instead.
So, to slow an attack of a Dragon, I should put his Dex at a value like 20. But this would give the Dragon poor abilities in other situations...Namely if he is chasing a PC he will get tired super quick.

Could a monster theoretically "equip" a non-modeled weapon for the sole purpose of adjusting combat rate?

For example, could I create a "dragon talon" weapon that uses Wrestling skill and has a damage 15-60 and a weaponspeed of 8? Then I could "equip" such a weapon on the Dragon -no model would show- But UOx3 would calculate damage based on the "weapon" the Dragon has equipped? This would be a neat feature, with lots of different flexibilites. (For example, I can use my global fire-damage script of I make the "Dragon weapon" Type 41.) This could be very dynamic in the PvM department.
phao
UOX3 Newbie
Posts: 24
Joined: Sat Aug 11, 2007 7:27 pm
Has thanked: 0
Been thanked: 0

Post by phao »

i don't need to chance the cap of dex that the UOX use to modify the speed, i need to edit the weapon speed when the player equips it, like i've told there.

Code: Select all

//exemple only
functio onEquip(user, item) {
item.speed = item.speed + 1231121; 
}
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post by Grimson »

I'll take a look on it the next time I work on the code. But keep in mind that the speed var is an unsigned 8-bit integer, so the maximum value is 255.
phao
UOX3 Newbie
Posts: 24
Joined: Sat Aug 11, 2007 7:27 pm
Has thanked: 0
Been thanked: 0

Post by phao »

ok, this isnt a problem for me, the max speed of a weapon i've seen is 60 or 56 (i cannot remember it correctly) and what i need is 2x that so 120 (in the max).

(sorry for english, it isnt my native language).
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post by Grimson »

stranf wrote:Could a monster theoretically "equip" a non-modeled weapon for the sole purpose of adjusting combat rate?
Try it, UOX3 shouldn't have a problem with it. I'm not shure how the client will handle it though, you might have to use the tile ID of an equipable item.
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

Thanks grimson, I'll test it out and report.

Phao: Sorry for sidetracking your thread, and you're English is very good!

I don't believe you could speed weapons faster than what you are reporting through JS, but you could possibly do it through C++. I better let Grimson answer that.
Post Reply