• 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 WeaponType Fist TFS 1.0

yeah but i get this error
[Warning - Items::parseItemNode] Unknown weaponType: fist

and ingame he say
you cannot dress this object there
 
Is this still working? I already did everything no erros in compiling or when opening the server but when the character is equipped with the fist equipment it does not attack, any clues?
 
Is this still working? I already did everything no erros in compiling or when opening the server but when the character is equipped with the fist equipment it does not attack, any clues?
He might be missing some things from the sources because I made something similar and mine works fine without error. Maybe I will release my variation if I have time today.
 
Yeah I figured it out yesterday around 4am haha so I couldnt post that I fixed it and yeah the value in enums.h and luascript.cpp were the ones that I was missing for fist now it is working :) Thank you
 
You forgot the changes necessary for Fist to work with offline training.

Old game.cpp section
Code:
Game::Game()
{
    offlineTrainingWindow.choices.emplace_back("Sword Fighting and Shielding", SKILL_SWORD);
    offlineTrainingWindow.choices.emplace_back("Axe Fighting and Shielding", SKILL_AXE);
    offlineTrainingWindow.choices.emplace_back("Club Fighting and Shielding", SKILL_CLUB);
    offlineTrainingWindow.choices.emplace_back("Distance Fighting and Shielding", SKILL_DISTANCE);
    offlineTrainingWindow.choices.emplace_back("Magic Level and Shielding", SKILL_MAGLEVEL);
    offlineTrainingWindow.buttons.emplace_back("Okay", 1);
    offlineTrainingWindow.buttons.emplace_back("Cancel", 0);
    offlineTrainingWindow.defaultEnterButton = 1;
    offlineTrainingWindow.defaultEscapeButton = 0;
    offlineTrainingWindow.priority = true;
}
New game.cpp section
Code:
Game::Game()
{
    offlineTrainingWindow.choices.emplace_back("Fist Fighting and Shielding", SKILL_FIST);
    offlineTrainingWindow.choices.emplace_back("Sword Fighting and Shielding", SKILL_SWORD);
    offlineTrainingWindow.choices.emplace_back("Axe Fighting and Shielding", SKILL_AXE);
    offlineTrainingWindow.choices.emplace_back("Club Fighting and Shielding", SKILL_CLUB);
    offlineTrainingWindow.choices.emplace_back("Distance Fighting and Shielding", SKILL_DISTANCE);
    offlineTrainingWindow.choices.emplace_back("Magic Level and Shielding", SKILL_MAGLEVEL);
    offlineTrainingWindow.buttons.emplace_back("Okay", 1);
    offlineTrainingWindow.buttons.emplace_back("Cancel", 0);
    offlineTrainingWindow.defaultEnterButton = 1;
    offlineTrainingWindow.defaultEscapeButton = 0;
    offlineTrainingWindow.priority = true;
}
Old game.cpp section
Code:
if (modalWindowId == std::numeric_limits<uint32_t>::max()) {
        if (button == 1) {
            if (choice == SKILL_SWORD || choice == SKILL_AXE || choice == SKILL_CLUB || choice == SKILL_DISTANCE || choice == SKILL_MAGLEVEL) {
                BedItem* bedItem = player->getBedItem();
New game.cpp section
Code:
if (modalWindowId == std::numeric_limits<uint32_t>::max()) {
        if (button == 1) {
            if (choice == SKILL_FIST || choice == SKILL_SWORD || choice == SKILL_AXE || choice == SKILL_CLUB || choice == SKILL_DISTANCE || choice == SKILL_MAGLEVEL) {
                BedItem* bedItem = player->getBedItem();
and lastly in the data/creaturescripts/scripts/offlinetraining.lua
change this
Code:
if isInArray({SKILL_CLUB, SKILL_SWORD, SKILL_AXE, SKILL_DISTANCE}, offlineTrainingSkill) then
to this
Code:
if isInArray({SKILL_FIST, SKILL_CLUB, SKILL_SWORD, SKILL_AXE, SKILL_DISTANCE}, offlineTrainingSkill) then
 
I did exactly this on TFS 1.2 but I cannot wear Fist weapons at all...
 
This is working for me on TFS 1.2, I just missed one part of the source editing.
 
Back
Top