Tfs 0.4 black skull

Yaboihunna

Member
Joined
Mar 27, 2019
Messages
125
Best answers
0
Reaction score
1
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
 

M0ustafa

Î Àm ŁĕğẹňĎ
Support Team
Joined
Mar 4, 2017
Messages
870
Best answers
90
Reaction score
308
Location
Egypt
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.
 
OP
Y

Yaboihunna

Member
Joined
Mar 27, 2019
Messages
125
Best answers
0
Reaction score
1
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
 

M0ustafa

Î Àm ŁĕğẹňĎ
Support Team
Joined
Mar 4, 2017
Messages
870
Best answers
90
Reaction score
308
Location
Egypt
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:
OP
Y

Yaboihunna

Member
Joined
Mar 27, 2019
Messages
125
Best answers
0
Reaction score
1
There isn't any black skulls in those files bc I removed it allready
 

M0ustafa

Î Àm ŁĕğẹňĎ
Support Team
Joined
Mar 4, 2017
Messages
870
Best answers
90
Reaction score
308
Location
Egypt
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
 
OP
Y

Yaboihunna

Member
Joined
Mar 27, 2019
Messages
125
Best answers
0
Reaction score
1
That's what I did I deleted all skull_blacks
 

M0ustafa

Î Àm ŁĕğẹňĎ
Support Team
Joined
Mar 4, 2017
Messages
870
Best answers
90
Reaction score
308
Location
Egypt
And black skull still has restrictions? If so, What are them?
 
OP
Y

Yaboihunna

Member
Joined
Mar 27, 2019
Messages
125
Best answers
0
Reaction score
1
Area spell double damage and summon creature

I got the itemloss fixed
It's just those three things
 

M0ustafa

Î Àm ŁĕğẹňĎ
Support Team
Joined
Mar 4, 2017
Messages
870
Best answers
90
Reaction score
308
Location
Egypt
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.
 
OP
Y

Yaboihunna

Member
Joined
Mar 27, 2019
Messages
125
Best answers
0
Reaction score
1
Didn't change sservers in notepad++ how do I find lines
 

M0ustafa

Î Àm ŁĕğẹňĎ
Support Team
Joined
Mar 4, 2017
Messages
870
Best answers
90
Reaction score
308
Location
Egypt
Ctrl + G then write the line number
 
Top