• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Feature True dual wielding for TFS 1.x

Lordfire

Intermediate OT User
TFS Developer
Joined
Jul 16, 2008
Messages
248
Solutions
3
Reaction score
138
GitHub
ranisalt
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:
This is cool as crap! Thanks man will use.

How can i choose which vocation this applies too?
 
Last edited:
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 :)
 
I assume that secondary damage won't work for both weapons at the same time, right?
 
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
 
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.
 
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
 
Cool release. I may modify this and use a custom variant for my project.

Thank you. ;)
 
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
 
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:
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.
 
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!
 
Wow this has some nice versatility.
Because of the way its done, you "could" have one handed crossbows...

Gonna save this for later.
 
Back
Top