• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Dual Wieldinf for vocations

whiteblXK

Active Member
Joined
Apr 20, 2011
Messages
315
Solutions
9
Reaction score
32
Location
Poland
Hello, I have TFS 0.4 r3884 and I do not know how to do this. I want to add option in vocations.xml like a dualwield="true". If vocations have this option enable(true) then he can use two weapons at the same time.
Can some one help me with this?
 
Last edited:
In vocation.cpp find:
Code:
if(readXMLString(p, "name", strValue))
...

and add after that if:
Code:
if(readXMLString(p, "dualwield", strValue))
        voc->setDual(strValue);


after:
Code:
attackable = true;

set:
Code:
dualwield= false;

vocation.h find:
Code:
        const std::string& getName() const {return name;}
        void setName(const std::string& v) {name = v;}

and after:
Code:
        bool isDual() const {return dualwield;}
        void setDual(bool v) {dualwield= v;}


change:
Code:
bool attackable, needPremium;

to:
Code:
bool attackable, needPremium, dualwield;


in player.cpp change:
http://wklej.to/UtdEN/text

for:
http://wklej.to/ujCTY/text

and:
http://wklej.to/A0bbx/text

for:
http://wklej.to/tasPm/text

Now in vocations.xml
Code:
<vocation id="1" name="Naruto Uzumaki" description="a Naruto Uzumaki" dualwield="true" needpremium="0"  ...

Not tested, created on tfs 0.3.6pl1
 
Last edited:
Thanks, I fixed errors and works perfectly :) I have one questions, if my axe doesn't have attribute dualwield="1" then when I equip two weapons that attack be summed?
 
Thanks, I fixed errors and works perfectly :) I have one questions, if my axe doesn't have attribute dualwield="1" then when I equip two weapons that attack be summed?

Could you post that errors?
Also IDK how it works on TFS 0.4+ , propably it adds damage, or it double attack speed.
 
Errors have been associated with does not declaring:
Code:
Vocation* voc = Vocations::getInstance()->getVocation(vocation_id);  //0.3.6.
Vocation* voc = Vocations::getInstance()->getVocation(vocationId);  //0.4
and
I change:
Code:
if(readXMLString(p, "dualwield", strValue))
voc->setDual(strValue);
to:
Code:
if(readXMLString(p, "dualwield", strValue))
voc->setDual(booleanString(strValue));
 
Back
Top