Page 1 of 1
weapon speed
Posted: Thu Aug 16, 2007 12:35 pm
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.
Posted: Thu Aug 16, 2007 3:55 pm
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.
Posted: Thu Aug 16, 2007 5:44 pm
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.
Posted: Thu Aug 16, 2007 5:50 pm
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.
Posted: Thu Aug 16, 2007 5:55 pm
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.
Posted: Thu Aug 16, 2007 6:00 pm
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.
Posted: Thu Aug 16, 2007 6:10 pm
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.
Posted: Thu Aug 16, 2007 6:12 pm
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;
}
Posted: Thu Aug 16, 2007 6:28 pm
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.
Posted: Thu Aug 16, 2007 6:32 pm
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).
Posted: Thu Aug 16, 2007 6:40 pm
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.
Posted: Thu Aug 16, 2007 6:46 pm
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.