Feature True dual wielding for TFS 1.x

ArkSeyonet

Chancho
Joined
Nov 11, 2008
Messages
201
Reaction score
11
Location
Louisiana, USA
// REHOST
https://drive.google.com/open?id=0B2Rmde6uTLyHVjFwM1FsSUt6LXM
Since the github link isn't working at all.

can you post fixes?
If you are having the problem that Itutorial had, then you need to do the following:

In configmanager.cpp

Search for:

Code:
boolean[ALLOW_CHANGEOUTFIT] = getGlobalBoolean(L, "allowChangeOutfit", true);
And add below it:

Code:
boolean[ALLOW_DUAL_WIELDING] = getGlobalBoolean(L, "allowDualWielding", true);
-------------------------------------------------------------------------------------------------
Then in configmanager.h

Search for:

Code:
ALLOW_CHANGEOUTFIT,
And add below it:

Code:
ALLOW_DUAL_WIELDING,
 
Last edited:

Sizaro

Legendary OT User
Joined
Aug 20, 2007
Messages
5,062
Reaction score
116
Location
Sweden
I tried to compile with this script on latest TFS sources and I'm getting an error on line 623 to 634.

error
Code:
error C2065: 'lastAttackHand': undeclared identifier
error C2065: 'blockSkillAdvance': undeclared identifier
lines
Code:
        void switchAttackHand() {
            lastAttackHand = lastAttackHand == HAND_LEFT ? HAND_RIGHT : HAND_LEFT;
        }
        slots_t getAttackHand() const {
            return lastAttackHand == HAND_LEFT ? CONST_SLOT_LEFT : CONST_SLOT_RIGHT;
        }
        void switchBlockSkillAdvance() {
            blockSkillAdvance = !blockSkillAdvance;
        }
        bool getBlockSkillAdvance() {
            return blockSkillAdvance;
        }
 

Ziker

Active Member
Joined
May 7, 2017
Messages
184
Reaction score
50
Location
Edinburgh
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.
It's been a while, so I'm wondering if this still works on TFS 1.2/1.3? If so, assuming you haven't done this already, would you mind perhaps creating a pull request to TFS regarding NPC idling optimizations? (Once again, assuming you haven't done this already which You probably have)
 

Lubinho Fit

Member
Joined
May 10, 2017
Messages
37
Reaction score
6
I installed everything patched etc, got the same error that Sizaro got, fixed it but i cant equip 2 weapons in game
The message changes from "You cannot dress this object there" to "Sorry, not possible"

Can someone help me ?
 

delita123

Member
Joined
Mar 7, 2017
Messages
105
Reaction score
19
I got a lot of erros in compile.
Otx 3.8, can somebody help me? I need this script a lot.
 

ObsidianQ

Member
Joined
Jan 26, 2017
Messages
93
Reaction score
5
Hello, theres few changes between 1.1 and 1.3, even between 1.1 and 1.2

For sample, I'm doing the mods manually and i have a small conflict here:

player.cpp
Code:
 @@ -108,6 +108,7 @@ Player::player(ProtocolGame* p) :
    lastAttackBlockType = BLOCK_NONE;
    addAttackSkillPoint = false;
    lastAttack = 0;
+ lastAttackHand = HAND_LEFT;
I can't find that part because it's been modified...

Same with player.h

Code:
    @@ -1293,6 +1311,8 @@ class Player final : public Creature, public Cylinder
    chaseMode_t chaseMode;
    fightMode_t fightMode;
    AccountType_t accountType;
+ attackHand_t lastAttackHand;
+ bool blockSkillAdvance;
vocation.cpp
Code:
    clientId = 0;
    fromVocation = VOCATION_NONE;
+ dualWield = true;
vocation.h
Code:
    uint8_t soulMax;
    uint8_t clientId;
+ bool dualWield;
+
    static uint32_t skillBase[SKILL_LAST + 1];
Can someone please help me to fix this to 1.3/current "master" ?
 

Fileey

Well-Known Member
Joined
Sep 30, 2009
Messages
45
Reaction score
6
What if you use melee in combination with ranged weapon, will it stop attack when you're out of range for a melee hit?
 

Digital

Learning C++
Joined
Jul 15, 2018
Messages
57
Reaction score
12
I tried installing this but it crashes my server it only gives Core Dump as an error. I've made other changes to the server to but they worked before i installed this feature. I hope they're not a conflict. I am thinking i should try and start to install this from a clean build.
 

Digital

Learning C++
Joined
Jul 15, 2018
Messages
57
Reaction score
12
Nevermind i put the information in the functions and that was why it crashing the server.
 

Togu

Active Member
Joined
Jun 22, 2018
Messages
244
Reaction score
97
Location
Brazil
Can somebody post how to do this without patch (I'm using TFS 1.3)? I changed many sources from my server and I don't want to make it automatic, I want to understand what I am doing.
 

Peonso

Godly Member
Joined
Jan 14, 2008
Messages
1,493
Reaction score
981
Can somebody post how to do this without patch (I'm using TFS 1.3)? I changed many sources from my server and I don't want to make it automatic, I want to understand what I am doing.
Read the patch file.
 

Togu

Active Member
Joined
Jun 22, 2018
Messages
244
Reaction score
97
Location
Brazil
"dualWieldingDamageRate" is not being used?
If you ctrl + f, its only used in configmanager.cpp and config.lua, it isnt being used in any formula.

"dualWieldingDamageRate" is not being used?
If you ctrl + f, its only used in configmanager.cpp and config.lua, it isnt being used in any formula.
Found it on line 357, lol.
 
Last edited by a moderator:

Togu

Active Member
Joined
Jun 22, 2018
Messages
244
Reaction score
97
Location
Brazil
I think I found an error... if I put a single club atk 7 and attack a orc warlord, I can't hit. But if I put a Magic Sword and a Club I do great hits with both weapons.
 

Togu

Active Member
Joined
Jun 22, 2018
Messages
244
Reaction score
97
Location
Brazil
And if I switch Magic Sword with Club (club in the right hand) I do weak hits. It's considering just the attack of the right hand weapon to do both attacks.
 

Togu

Active Member
Joined
Jun 22, 2018
Messages
244
Reaction score
97
Location
Brazil
Nevermind, my mistake, I forgot to put:
Code:
player->switchAttackHand();
 

Stanos

Active Member
Joined
Jun 12, 2018
Messages
375
Reaction score
128
What if i have club fighting as a attack speed so its pretty much impossible to install this function with this main stage. So basically you have to replace important part with dual wielding so its like if you want to add this system i have to sacrifice important function from my source that takes a big part in my server.
 
Top