• 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!

Trying to combine skills enums.h gives a lot of error

Stanos

Advanced OT User
Joined
Jun 12, 2018
Messages
518
Reaction score
233
Hi
so i'm trying to combine SKILL_SWORD = SKILL_AXE, so lets say if i kill my sword axe should skill to.
Code:
enum skills_t : uint8_t {
    SKILL_FIST = 0,
    SKILL_CLUB = 1,
    SKILL_SWORD = 2,
    SKILL_AXE = 3,
    SKILL_DISTANCE = 4,
    SKILL_SHIELD = 5,
    SKILL_FISHING = 6,

    SKILL_MAGLEVEL = 7,
    SKILL_LEVEL = 8,

    SKILL_FIRST = SKILL_FIST,
    SKILL_SWORD = SKILL_AXE,
    SKILL_LAST = SKILL_FISHING
};
So now when i try to compile source it gives me a lot of errors. What am i doing wrong?
 
Solution
In weapons.cpp
C++:
void Weapon:onUsedWeapon(Player* player, Item* item, Tile* destTile) const

Search for:
C++:
        if (getSkillType(player, item, skillType, skillPoint)) {
            player->addSkillAdvance(skillType, skillPoint);
        }

and replace it to:
C++:
        if (getSkillType(player, item, skillType, skillPoint)) {
            player->addSkillAdvance(skillType, skillPoint);
          
            if(skillType == SKILL_AXE)
                player->addSkillAdvance(SKILL_SWORD, 1);
        }

Next find:
C++:
bool Weapon::useFist(Player* player, Creature* target)

and below this:
C++:
player->addSkillAdvance(SKILL_FIST, 1);
add:
C++:
player->addSkillAdvance(SKILL_SWORD, 1);
OP
OP
Stanos

Stanos

Advanced OT User
Joined
Jun 12, 2018
Messages
518
Reaction score
233
you said you were using one of the 'skills' as the basis of a critical system!!
Yea i said but maybe i didn't mentioned correctly that was my bad so i'm sorry for that. I meant to say i need to combine axe fighting with sword fighting so if you pic a weapon which is attribute axe it skills both them at the same time, because i use only axe attribute in my server. Skill like sword fighting doesnt exist in my server i changed the name to critical so thats why i need it to combine them.
 

Shadow_

Veteran OT User
Joined
Jun 2, 2018
Messages
921
Solutions
30
Reaction score
346
i can try to help you just can you send the error and ur C++ script of skills again cause i will not read all of this ? xD
 

whiteblXK

Member
Joined
Apr 20, 2011
Messages
311
Solutions
9
Reaction score
24
Location
Poland
In weapons.cpp
C++:
void Weapon:onUsedWeapon(Player* player, Item* item, Tile* destTile) const

Search for:
C++:
        if (getSkillType(player, item, skillType, skillPoint)) {
            player->addSkillAdvance(skillType, skillPoint);
        }

and replace it to:
C++:
        if (getSkillType(player, item, skillType, skillPoint)) {
            player->addSkillAdvance(skillType, skillPoint);
          
            if(skillType == SKILL_AXE)
                player->addSkillAdvance(SKILL_SWORD, 1);
        }

Next find:
C++:
bool Weapon::useFist(Player* player, Creature* target)

and below this:
C++:
player->addSkillAdvance(SKILL_FIST, 1);
add:
C++:
player->addSkillAdvance(SKILL_SWORD, 1);
 
Solution
Top