Feature True dual wielding for TFS 1.x

Lordfire

aka ranisalt
Joined
Jul 16, 2008
Messages
237
Reaction score
106
Location
Florianópolis/SC - Brazil
I have seen a few dual wielding systems in the past but none of them was complete and simple to use. I started one from scratch that intends to be both simple, work out of the box and be easy to configure.

As I am developing my own server, I want to share some of my patches with the community. This is just the first one :)

Link to the patch: https://gist.github.com/ranisalt/8aad87afcca2905f6e89
How to apply: if you are on Linux, put the patch on the root folder of your server (the folder that contains src/ and config.lua) and run:
Code:
patch -p1 -i the-name-of-the-patch-file.patch
Otherwise if you run Windows, download patch from here and run:
Code:
patch.exe -p1 --binary -i the-name-of-the-patch-file.patch
If there is no error, you are good to go! Recompile your server and check the new flags in config.lua.

How to configure
All one-handed melee weapons are enable, as I didn't want to provide a way to restrict weapons from being dual wielded. Dual wielding provides a modified attack speed and damage.

Change allowDualWielding on config.lua to enable dual weapon wielding. Remember you need to set classicEquipmentSlots to true too to wield weapon on the right hand slot.

Change dualWieldingSpeedRate to the percentage of speed bonus, e.g. set it to 200 if you want dual wielding attack to be twice as fast.

Change dualWieldingDamageRate to the percentage of damage, e.g. set it to 60 if you want every dual wielding hit, that is one from each hand, to be 60% of the damage it would be single-wielded.

You can enable or disable the system globally with allowDualWielding, or you can disable it for vocations by setting dualwield="no" on them at vocations.xml. It defaults to enabled.

The player will train both skills (if weapons are from different classes) at half the rate (1 try every 2 hits) while dual wielding. Single wielding is unaffected. The weapons will be switched at every attack, one being from the left hand, the next from the right hand. The defending weapon will be the free one, that is, the one that is not attacking.

Liked it? Don't forget to drop a star by my Forgotten fork, it has more interesting stuff :D

Thanks and please report any issues you might find!
 
Last edited:

strutZ

Australian OT Member {AKA Beastn}
Joined
Nov 16, 2014
Messages
1,338
Reaction score
469
This is cool as crap! Thanks man will use.

How can i choose which vocation this applies too?
 
Last edited:
OP
Lordfire

Lordfire

aka ranisalt
Joined
Jul 16, 2008
Messages
237
Reaction score
106
Location
Florianópolis/SC - Brazil
Well, you actually don't.

As bows and crossbows are two handed, they can not be dual-wielded. There is no point in using dual-wielded spears/stars, as bows/crossbows can be stronger and you lose the shield defense anyways. So, paladins don't benefit from the ability. The same for mages: they hardly do any damage with melee/distance weapons, and dual-wielding rods and wands would drain their mana too fast.

Although it's easy to modify the code and only allow knights to dual wield (or even better, only dual wield melee weapons), I think it doesn't help too much. Of course, I can do it if you prefer :)
 

Colors

Joined
Mar 22, 2013
Messages
935
Reaction score
250
I assume that secondary damage won't work for both weapons at the same time, right?
 

strutZ

Australian OT Member {AKA Beastn}
Joined
Nov 16, 2014
Messages
1,338
Reaction score
469
Well, you actually don't.

As bows and crossbows are two handed, they can not be dual-wielded. There is no point in using dual-wielded spears/stars, as bows/crossbows can be stronger and you lose the shield defense anyways. So, paladins don't benefit from the ability. The same for mages: they hardly do any damage with melee/distance weapons, and dual-wielding rods and wands would drain their mana too fast.

Although it's easy to modify the code and only allow knights to dual wield (or even better, only dual wield melee weapons), I think it doesn't help too much. Of course, I can do it if you prefer :)
Making custom vocs so if i could limit it to one voc it would be better haha
 
OP
Lordfire

Lordfire

aka ranisalt
Joined
Jul 16, 2008
Messages
237
Reaction score
106
Location
Florianópolis/SC - Brazil
I assume that secondary damage won't work for both weapons at the same time, right?
At the same time, no. The weapons secondary damage switches with them :p e.g. if you wield a serpent sword and a fire sword, the extra earth damages comes with the serpent sword hit, the extra fire damage comes next with the fire sword.
Making custom vocs so if i could limit it to one voc it would be better haha
Okay, I will make a switch to disable or enable it for each vocation.
 

strutZ

Australian OT Member {AKA Beastn}
Joined
Nov 16, 2014
Messages
1,338
Reaction score
469
At the same time, no. The weapons secondary damage switches with them :p e.g. if you wield a serpent sword and a fire sword, the extra earth damages comes with the serpent sword hit, the extra fire damage comes next with the fire sword.

Okay, I will make a switch to disable or enable it for each vocation.
What a boss
 

J.Dre

ClapSoft®
Joined
May 18, 2011
Messages
2,586
Reaction score
543
Location
United States
Cool release. I may modify this and use a custom variant for my project.

Thank you. ;)
 

strutZ

Australian OT Member {AKA Beastn}
Joined
Nov 16, 2014
Messages
1,338
Reaction score
469
just as a FYI to others using 'CentOS' if you cannot run the patch command you will need to install it with this

Code:
yum install patch
 
OP
Lordfire

Lordfire

aka ranisalt
Joined
Jul 16, 2008
Messages
237
Reaction score
106
Location
Florianópolis/SC - Brazil
What about a special storage for the Dual Wielding?
A special storage for what?
just as a FYI to others using 'CentOS' if you cannot run the patch command you will need to install it with this

Code:
yum install patch
Yes! That goes for CentOS, Red Hat and Fedora < 22 too.
 
Last edited:
OP
Lordfire

Lordfire

aka ranisalt
Joined
Jul 16, 2008
Messages
237
Reaction score
106
Location
Florianópolis/SC - Brazil
What other features does your branch has mayI ask?
I have ported experience stages and bug report to Lua, I have made that Tibia system that gives bonus experience for low level players, I have skill stages and passive monsters, and also a major fix to NPC idling that reduces CPU usage by half, all of which I pretend to post here sometime.

Also I have lots of fixes, such as debug assertion when mounting with gamemaster outfit, applying skill rate to offline training and player guild rank on look.
 

luigilc

Lua Learner
Joined
Mar 24, 2010
Messages
863
Reaction score
36
Location
A music box
I have ported experience stages and bug report to Lua, I have made that Tibia system that gives bonus experience for low level players, I have skill stages and passive monsters, and also a major fix to NPC idling that reduces CPU usage by half, all of which I pretend to post here sometime.

Also I have lots of fixes, such as debug assertion when mounting with gamemaster outfit, applying skill rate to offline training and player guild rank on look.
Oh wow, that's a lot, I especially like the bonus exp for low level players, will definetely check it out!
 

Leo32

Getting back into it...
Joined
Sep 21, 2007
Messages
724
Reaction score
121
Wow this has some nice versatility.
Because of the way its done, you "could" have one handed crossbows...

Gonna save this for later.
 
Top