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

Tfs 0.4 black skull

Yaboihunna

New Member
Joined
Mar 27, 2019
Messages
136
Reaction score
3
Need help fixing blackskull
Need to remove extra damage to black skull
And able to use area spells
I did everything in changes you need for hardcore war server compiled with success but black skulled players still can't use area spells and take more damage
 
Solution
in combat.cpp remove this
C++:
        if(player->getSkull() == SKULL_BLACK)
            return RET_YOUMAYNOTATTACKTHISPLAYER;
in spells.cpp remove this
C++:
        if(player->getSkull() == SKULL_BLACK)
        {
            player->sendCancelMessage(RET_NOTPOSSIBLE);
            g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
            return false;
        }
C++:
    if(player->getSkull() == SKULL_BLACK)
    {
        player->sendCancelMessage(RET_YOUMAYNOTATTACKTHISPLAYER);
        g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
        return false;
    }
C++:
    if(!needTarget)
    {
        if(!isAggressive || player->getSkull() != SKULL_BLACK)
            return true...
in combat.cpp remove this
C++:
        if(player->getSkull() == SKULL_BLACK)
            return RET_YOUMAYNOTATTACKTHISPLAYER;
in spells.cpp remove this
C++:
        if(player->getSkull() == SKULL_BLACK)
        {
            player->sendCancelMessage(RET_NOTPOSSIBLE);
            g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
            return false;
        }
C++:
    if(player->getSkull() == SKULL_BLACK)
    {
        player->sendCancelMessage(RET_YOUMAYNOTATTACKTHISPLAYER);
        g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
        return false;
    }
C++:
    if(!needTarget)
    {
        if(!isAggressive || player->getSkull() != SKULL_BLACK)
            return true;

        player->sendCancelMessage(RET_YOUMAYNOTCASTAREAONBLACKSKULL);
        g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
        return false;
    }
CoffeeScript:
    if(player->getSkull() == SKULL_BLACK && isAggressive && range == -1) //-1 is (usually?) an area spell
    {
        player->sendCancelMessage(RET_YOUMAYNOTCASTAREAONBLACKSKULL);
        g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
        return false;
    }
C++:
        if(player->getSkull() == SKULL_BLACK)
        {
            player->sendCancelMessage(RET_NOTPOSSIBLE);
            g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
            return false;
        }
Just search for SKULL_BLACK in combat.cpp/player.cpp/spells.cpp and remove them all.
Sorry about the PM thing but I am tired and tense since I have army recall in real life and I think I gonna quit soon so I am just chilling/relaxing even stopped doing my OT and everything.
 
Solution
Search "Skull_Black" (6 hits in 3 files)
D:\server\src\const.h (2 hits)
Line 396: SKULL_BLACK,
Line 397: SKULL_LAST = SKULL_BLACK
D:\server\src\player.cpp (3 hits)
Line 823: if(skull > SKULL_BLACK || (item->getContainer() && tmp < loss) || (!item->getContainer() && tmp < itemLoss))
Line 4288: if(skull < SKULL_BLACK && ((d > 0 && tc >= d) || (w > 0 && wc >= w) || (m > 0 && mc >= m)))
Line 4290: setSkullEnd(now + g_config.getNumber(ConfigManager::BLACK_SKULL_LENGTH), false, SKULL_BLACK);
D:\server\src\tools.cpp (1 hit)
Line 718: return SKULL_BLACK;

I did the search in file function with notepad++ this is what I got I don't see why the blackskull still has the restrictions
 
Combat.cpp/player.cpp/spells.cpp
You need to remove the ones in these only and then black skull will have 0 restrictions
Open them one by one and search/remove lines until there's no black_skull restrictions at all. I did that and it worked for me.
 
Last edited:
The only black skull restrictions can be found in Combat.cpp/player.cpp/spells.cpp
If you removed all black skull related lines there then it will not have any restrictions.
just search properly mark Backward direction/Wrap around only then search for SKULL_BLACK
 
And black skull still has restrictions? If so, What are them?
 
That is the area spell restrict and it can be found on spells.cpp line 825
C++:
    if(player->getSkull() == SKULL_BLACK && isAggressive && range == -1) //-1 is (usually?) an area spell
    {
        player->sendCancelMessage(RET_YOUMAYNOTCASTAREAONBLACKSKULL);
        g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
        return false;
    }

    return true;
That is the double damage restrict and it can be found on combat.cpp line 559
C++:
    if(change < 0 && caster && caster->getPlayer() && target->getPlayer() && target->getPlayer()->getSkull() != SKULL_BLACK)
        change = change / 2;
and I think that is the summon restriction and it can be found on player.cpp line 4303
C++:
        if(skull < SKULL_BLACK && ((d > 0 && tc >= d) || (w > 0 && wc >= w) || (m > 0 && mc >= m)))
        {
            setSkullEnd(now + g_config.getNumber(ConfigManager::BLACK_SKULL_LENGTH), false, SKULL_BLACK);
            setAttackedCreature(NULL);
            destroySummons();
        }
    }
as I mentioned above if you removed all lines related to black skull from combat.cpp/spells.cpp/players.cpp then there will not be any restrictions at all, I am not sure how cannot you find them by searching but did you change your TFS from 0.4 3777 the one I gave to other one? if not then its 100% there.
 
Back
Top