• 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.X Exiva only players with frags

kennyubuntu

Member
Joined
May 20, 2016
Messages
150
Reaction score
13
I found this topic here: TFS 0.X - Exiva only in PKs (find person) (https://otland.net/threads/exiva-only-in-pks-find-person.276701/)
It blocks exiva only for white,red,black and yellow skull...
Amazing idea, players can train/hunt in peace if they are not in pk teams, wars...

But it break the revenge kill feature, if someone kills you, you have only the PZ time to kill the player

What about can exiva players with frags, i mean, you u do !frags shows:
Code:
03:49 You currently have 1 frags today, 1 this week and 1 this month. 03:49 Last frag at 23 June 2021 03:49:50 on level 18 (Dan).

Anybody knows how to do?
 
The whole idea simplified is to add a condition playerHaveInjustsFrags on this if on spells.cpp (Fir3element/3777 (https://github.com/Fir3element/3777/blob/master/src/spells.cpp#L1292)):
Code:
bool InstantSpell::SearchPlayer(const InstantSpell*, Creature* creature, const std::string& param)
{
    Player* player = creature->getPlayer();
    if(!player || player->isRemoved())
        return false;

    Player* targetPlayer = NULL;
    ReturnValue ret = g_game.getPlayerByNameWildcard(param, targetPlayer);
    if(ret != RET_NOERROR || !targetPlayer || targetPlayer->isRemoved())
    {
        player->sendCancelMessage(ret);
        g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
        return false;
    }

    if(targetPlayer->hasCustomFlag(PlayerCustomFlag_NotSearchable) && !player->hasCustomFlag(PlayerCustomFlag_GamemasterPrivileges))
    {
        player->sendCancelMessage(RET_PLAYERWITHTHISNAMEISNOTONLINE);
        g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
        return false;
    }

    // <exiva only in PKs>
    if(
      (targetPlayer->getSkull() != SKULL_BLACK
    && targetPlayer->getSkull() != SKULL_WHITE
    && targetPlayer->getSkull() != SKULL_RED
    )
           && (!(targetPlayer->isPzLocked()))
    ) {
        player->sendCancelMessage(RET_CREATUREISNOTREACHABLE);
        g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
        return false;
    }
    // </exiva only in PKs>

    std::stringstream ss;
    ss << targetPlayer->getName() << " " << g_game.getSearchString(player->getPosition(), targetPlayer->getPosition(), true, true) << ".";
    player->sendTextMessage(MSG_INFO_DESCR, ss.str().c_str());

    g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_WRAPS_BLUE);
    return true;
}
 
Back
Top