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

Solved C++ 0.4 Follow Changes

changos

Member
Joined
Feb 13, 2012
Messages
75
Solutions
5
Reaction score
22
Hi Otland community im editing the source of OTX 2.9 based on tfs (0.4)
and i modified the follow function to prevent a combo follow for a war server
it is working but not as would i like, because this affect the follow atk mode too
players.cpp
C++:
void Player::goToFollowCreature()
{
    //if(!walkTask)
        //Creature::goToFollowCreature();
    //return 0;
  
    if (!walkTask && g_config.getBool(ConfigManager::ANTI_COMBO_FOLLOW))
    {
     Creature::goToFollowCreature();
     }
     else
     {
      //setFollowCreature(NULL);
     }
}
follow atk code:
C++:
void Player::setChaseMode(chaseMode_t mode)
{
    if(chaseMode == mode)
        return;

    chaseMode = mode;
    if(chaseMode == CHASEMODE_FOLLOW)
    {
        if(!followCreature && attackedCreature && !getNoMove()) //chase opponent
            setFollowCreature(attackedCreature);
    }
    else if(attackedCreature)
    {
        setFollowCreature(NULL);
        cancelNextWalk = true;
    }
}

I hope you can help me, thanks.
 
Solution
SOLVED: i edit the function called void Player::goToFollowCreature()
only replace on player.cpp

C++:
void Player::goToFollowCreature()
{
 if(!walkTask)
     Creature::goToFollowCreature();
}

C++:
void Player::goToFollowCreature()
{
    if (chaseMode == CHASEMODE_FOLLOW && g_config.getBool(ConfigManager::ANTI_COMBO_FOLLOW) && !walkTask) 
    {
            Creature::goToFollowCreature();
    }
    else if (!chaseMode == CHASEMODE_FOLLOW && !g_config.getBool(ConfigManager::ANTI_COMBO_FOLLOW) && followCreature)
    {
        setFollowCreature(NULL);
        cancelNextWalk = true;
    }
}

and add on configmanager.cpp

C++:
 m_confBool[ANTI_COMBO_FOLLOW] = getGlobalBool("antiComboFollow", true);

add below of ADDONS_PREMIUM configmanager.h...
i want to disable the follow to prevent combo aimbot wh follow
and without affect the follow atk target
 
Last edited:
use this script:
Lua:
function onFollow(cid, follow)
    if isPlayer(cid) then
        local target = getCreatureTarget(cid)
        if target == follow then
            return true
        end
        if getConfigValue("antiComboFollow") == true then
            return false
        end
    end
    return true
end

creaturescripts.xml
Code:
<event type="follow" name="antiComboFollow" event="script" value="antiComboFollow.lua"/>

login.lua
Code:
registerCreatureEvent(cid, "antiComboFollow")
 
Lo queria hacer por medio de sources por eso no meti script de lua xd

igual sera de mientras una solucion temporal gracias te amo <3
lo cheque y funciona lo de bloquear el follow pero con el atk follow no para de seguirlo aunque desactives el atk follow mode solo lo para de seguir hasta que dejes de atacarlo
 
SOLVED: i edit the function called void Player::goToFollowCreature()
only replace on player.cpp

C++:
void Player::goToFollowCreature()
{
 if(!walkTask)
     Creature::goToFollowCreature();
}

C++:
void Player::goToFollowCreature()
{
    if (chaseMode == CHASEMODE_FOLLOW && g_config.getBool(ConfigManager::ANTI_COMBO_FOLLOW) && !walkTask) 
    {
            Creature::goToFollowCreature();
    }
    else if (!chaseMode == CHASEMODE_FOLLOW && !g_config.getBool(ConfigManager::ANTI_COMBO_FOLLOW) && followCreature)
    {
        setFollowCreature(NULL);
        cancelNextWalk = true;
    }
}

and add on configmanager.cpp

C++:
 m_confBool[ANTI_COMBO_FOLLOW] = getGlobalBool("antiComboFollow", true);

add below of ADDONS_PREMIUM configmanager.h

C++:
 ANTI_COMBO_FOLLOW,
 
Solution
Back
Top