Reanimate ac1 project

Since i got some time due my bad flu lawl… i was thinking about reviving the ac1.

Offcourse i took the latest part and was offcourse not able to merge, since well the code is old… not truly really old but old enough to not being able to merge.

the first problem was MovementHandler.cpp but i fixed that, since that was merely inserting the code again… i havent looked if it compiles yet, just inserted it on the place where it should be according the patch.

now the second error was on: SpellAuraeffects.cpp

there is an interesting problem, since the original code in the patch is totally rewritten and or/is outdated.

I managed to find where it was originaly, and here is where the problem is.

the new code, current code as it is on the trinity repo

[CODE]
void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode, bool apply) const
{
if (!(mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK))
return;

Unit* target = aurApp->GetTarget();

if (!apply)
{
    // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
    if (target->HasAuraType(GetAuraType()) || target->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))
        return;
}

//! Not entirely sure if this should be sent for creatures as well, but I don't think so.
target->SetCanFly(apply);
if (!apply)
{
    target->RemoveUnitMovementFlag(MOVEMENTFLAG_MASK_MOVING_FLY);
    target->GetMotionMaster()->MoveFall();
    target->m_movementInfo.SetFallTime(0);
}

Player* player = target->ToPlayer();
if (!player)
    player = target->m_movedPlayer;

if (player)
    player->SendMovementCanFlyChange();

//! We still need to initiate a server-side MoveFall here,
//! which requires MSG_MOVE_FALL_LAND on landing.

}
[/CODE]
[/code]

now the patch says this:

[code]
— a/src/server/game/Spells/Auras/SpellAuraEffects.cpp

+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp

@@ -2852,9 +2852,21 @@ void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode

     // allow flying

     WorldPacket data;

     if (apply)
  •    {
    
  •        if (target->GetTypeId() == TYPEID_PLAYER)
    
  •            target->ToPlayer()->m_anti_BeginFallZ=INVALID_HEIGHT;
    
           data.Initialize(SMSG_MOVE_SET_CAN_FLY, 12);
    
  •    }
    
       else
    
  •    {
    
           data.Initialize(SMSG_MOVE_UNSET_CAN_FLY, 12);
    
  •    }
    
  •    if (target->GetTypeId() == TYPEID_PLAYER)
    
  •    {
    
  •        target->ToPlayer()->SetCanFly(apply);
    
  •    }
    
     data.append(target->GetPackGUID());

     data << uint32(0);                                      // movement counter

     player->SendDirectMessage(&data);

@@ -2901,6 +2913,8 @@ void AuraEffect::HandleAuraFeatherFall(AuraApplication const* aurApp, uint8 mode

 if (apply)

     target->AddUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW);
  •    if (target->GetTypeId() == TYPEID_PLAYER)
    
  •        target->ToPlayer()->m_anti_BeginFallZ=INVALID_HEIGHT;
    

    else

       target->RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW);
    

@@ -3253,6 +3269,9 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp,

                 data.Initialize(SMSG_MOVE_SET_CAN_FLY, 12);

             else

                 data.Initialize(SMSG_MOVE_UNSET_CAN_FLY, 12);
  •            if (target->GetTypeId() == TYPEID_PLAYER)
    
  •                target->ToPlayer()->SetCanFly(apply);
    
               data.append(player->GetPackGUID());
    
               data << uint32(0);                                      // unknown
    
               player->SendDirectMessage(&data);
    

so im on a dead end right now, and my lack of C++ is making me from going further…
so any advice on where to look on hw to fix would be awesome, and im sure alot of people would love to see ac1 back, so thats why i started this.

gr.

found the revision where the spellauraeffects.cpp was changed so that it was not mergable anymore : https://github.com/TrinityCore/TrinityCore/commit/f8c04b1bc56fa67553a3e8706a07f5edf2ce183e so i t was long ago /emoticons/default_tongue.png

i dont know if Machiavell1 has an idea on how to inplement the code right now where im stuck.

or maybe its not even needed anymore??

https://github.com/TrinityCore/TrinityCore/commit/f8c04b1bc56fa67553a3e8706a07f5edf2ce183e

okay lets assume that spellauraeffect is not needed for something, lets assume that ( dont think so )

i tried to compile it without modification to that file.

there was only a error or a few on compiling with movementhandler.cpp

[CODE][ 34%] Building CXX object src/server/game/CMakeFiles/game.dir/Handlers/DuelHandler.cpp.o

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp: In member function ‘bool Player::Anti__CheatOccurred(const char*, float, uint16, float, uint32, const MovementInfo*, bool)’:

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp:118: error: no matching function for call to ‘Log::outError(const char [45])’

/home/trinity/TrinityCore/src/server/shared/Logging/Log.h:52: note: candidates are: void Log::outError(LogFilterType, const char*, …)

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp:132: error: cannot convert ‘const std::basic_string<char, std::char_traits, std::allocator >’ to ‘const char*’ in initialization

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp:157: error: no matching function for call to ‘Log::outError(const char [42])’

/home/trinity/TrinityCore/src/server/shared/Logging/Log.h:52: note: candidates are: void Log::outError(LogFilterType, const char*, …)

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp: In member function ‘void WorldSession::HandleMovementOpcodes(WorldPacket&)’:

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp:568: error: ‘plMover’ was not declared in this scope

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp:638: error: ‘MOVEMENTFLAG_JUMPING’ was not declared in this scope

[ 34%] [ 34%] Building CXX object src/server/scripts/CMakeFiles/scripts.dir/Examples/example_escort.cpp.o

Building CXX object src/server/game/CMakeFiles/game.dir/Handlers/GroupHandler.cpp.o

[ 34%] Building CXX object src/server/game/CMakeFiles/game.dir/Handlers/TaxiHandler.cpp.o

[ 34%] Building CXX object src/server/scripts/CMakeFiles/scripts.dir/Examples/example_creature.cpp.o

make[2]: *** [src/server/game/CMakeFiles/game.dir/Handlers/MovementHandler.cpp.o] Error 1

make[2]: *** Waiting for unfinished jobs…

[ 35%] Building CXX object src/server/scripts/CMakeFiles/scripts.dir/Examples/example_spell.cpp.o

[ 35%] Building CXX object src/server/scripts/CMakeFiles/scripts.dir/Examples/example_commandscript.cpp.o

[ 35%] Building CXX object src/server/scripts/CMakeFiles/scripts.dir/__/game/AI/ScriptedAI/ScriptedEscortAI.cpp.o

[ 35%] Building CXX object src/server/scripts/CMakeFiles/scripts.dir/__/game/AI/ScriptedAI/ScriptedCreature.cpp.o

[ 35%] Building CXX object src/server/scripts/CMakeFiles/scripts.dir/__/game/AI/ScriptedAI/ScriptedFollowerAI.cpp.o

[ 35%] Building CXX object src/server/scripts/CMakeFiles/scripts.dir/World/achievement_scripts.cpp.o

[ 35%] Building CXX object src/server/scripts/CMakeFiles/scripts.dir/World/areatrigger_scripts.cpp.o

[ 35%] Building CXX object src/server/scripts/CMakeFiles/scripts.dir/World/boss_emerald_dragons.cpp.o

make[1]: *** [src/server/game/CMakeFiles/game.dir/all] Error 2

make[1]: *** Waiting for unfinished jobs…

[/CODE]

as we can see the problem is evident since the new loggin system, so that should be easy to fix, but the others are not as far as my knowledge goes…

It should be:

void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode, bool apply) const
{
if (!(mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK))
return;

Unit* target = aurApp->GetTarget();

if (!apply)
{
    // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
    if (target->HasAuraType(GetAuraType()) || target->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))
        return;
}

//! Not entirely sure if this should be sent for creatures as well, but I don't think so.
target->SetCanFly(apply);
if (!apply)
{
    target->RemoveUnitMovementFlag(MOVEMENTFLAG_MASK_MOVING_FLY);
    target->GetMotionMaster()->MoveFall();
    target->m_movementInfo.SetFallTime(0);
}

Player* player = target->ToPlayer();
if (!player)
    player = target->m_movedPlayer;

if (player)
  • {
    player->SendMovementCanFlyChange();
  •   if(apply)
    
  •       player->m_anti_BeginFallZ=INVALID_HEIGHT;            
    
  • }
//! We still need to initiate a server-side MoveFall here,
//! which requires MSG_MOVE_FALL_LAND on landing.

}

void AuraEffect::HandleAuraFeatherFall(AuraApplication const* aurApp, uint8 mode, bool apply) const
{
if (!(mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK))
return;

Unit* target = aurApp->GetTarget();

if (!apply)
{
    // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
    if (target->HasAuraType(GetAuraType()))
        return;
}

if (apply)
  • {
    target->AddUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW);
  •   if(Player* player = target->ToPlayer())
    
  •       player->m_anti_BeginFallZ=INVALID_HEIGHT;
    
  • }else
    target->RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW);
target->SendMovementFeatherFall();

// start fall from current height
if (!apply && target->GetTypeId() == TYPEID_PLAYER)
    target->ToPlayer()->SetFallInformation(0, target->GetPositionZ());

}
I haven’t tested it and can’t test it, though I guess this is the correct approach.

Btw, original code was missing brackets here, otherwise it makes no sense at all:

[CODE]
if (apply)
+{
target->AddUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW);

  •    if (target->GetTypeId() == TYPEID_PLAYER)
    
  •        target->ToPlayer()->m_anti_BeginFallZ=INVALID_HEIGHT;
    

+} else[/CODE]

thanks will give that a try, i need to fix the compiles first that are on the movementhandler.cpp

if thats fixed then i think it compiles also with your code and then i can do a test run and see if it works.

okay let me at least say we have only now compile errors on indeed the movementhandler.cpp file wich is pointing to the new logging system, so that can be fixed rather easy.

[CODE][ 32%] /home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp: In member function ‘bool Player::Anti__CheatOccurred(const char*, float, uint16, float, uint32, const MovementInfo*, bool)’:

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp:118: error: no matching function for call to ‘Log::outError(const char [45])’

/home/trinity/TrinityCore/src/server/shared/Logging/Log.h:52: note: candidates are: void Log::outError(LogFilterType, const char*, …)

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp:132: error: cannot convert ‘const std::basic_string<char, std::char_traits, std::allocator >’ to ‘const char*’ in initialization

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp:157: error: no matching function for call to ‘Log::outError(const char [42])’

/home/trinity/TrinityCore/src/server/shared/Logging/Log.h:52: note: candidates are: void Log::outError(LogFilterType, const char*, …)

Building CXX object src/server/game/CMakeFiles/game.dir/Handlers/GuildHandler.cpp.o

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp: In member function ‘void WorldSession::HandleMovementOpcodes(WorldPacket&)’:

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp:568: error: ‘plMover’ was not declared in this scope

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp:638: error: ‘MOVEMENTFLAG_JUMPING’ was not declared in this scope

[ 32%] Building CXX object src/server/game/CMakeFiles/game.dir/Handlers/DuelHandler.cpp.o

[ 32%] Building CXX object src/server/scripts/CMakeFiles/scripts.dir/Commands/cs_guild.cpp.o

make[2]: *** [src/server/game/CMakeFiles/game.dir/Handlers/MovementHandler.cpp.o] Error 1

make[2]: *** Waiting for unfinished jobs…

[ 32%] Building CXX object src/server/scripts/CMakeFiles/scripts.dir/Commands/cs_honor.cpp.o

[ 32%] Building CXX object src/server/scripts/CMakeFiles/scripts.dir/Commands/cs_instance.cpp.o

[ 32%] Building CXX object src/server/scripts/CMakeFiles/scripts.dir/Commands/cs_learn.cpp.o

[ 32%] Building CXX object src/server/scripts/CMakeFiles/scripts.dir/Commands/cs_lfg.cpp.o

[ 33%] Building CXX object src/server/scripts/CMakeFiles/scripts.dir/Commands/cs_list.cpp.o

[ 33%] Building CXX object src/server/scripts/CMakeFiles/scripts.dir/Commands/cs_lookup.cpp.o

make[1]: *** [src/server/game/CMakeFiles/game.dir/all] Error 2

make[1]: *** Waiting for unfinished jobs…

[/CODE]

to fix the logging problem i think its best to change

sLog->outError("Anti__ReportCheat: Missing Reason parameter!");

to

sLog->outInfo(LOG_FILTER_CHARACTER, "Anti__ReportCheat: Missing Reason parameter!"());

and

sLog->outError("Anti__ReportCheat: Player with no name?!?");

to

sLog->outInfo(LOG_FILTER_CHARACTER, "Anti__ReportCheat: Player with no name?!?"());

when done, we have a few compile errors less, at least for the logging system ^^ yeah.

so now we only have these compile errors left, and there i need som pro help with.

[CODE]Building CXX object src/server/game/CMakeFiles/game.dir/Movement/MovementGenerators/IdleMovementGenerator.cpp.o

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp: In member function ‘bool Player::Anti__CheatOccurred(const char*, float, uint16, float, uint32, const MovementInfo*, bool)’:

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp:118: error: ‘“Anti__ReportCheat: Missing Reason parameter!”’ cannot be used as a function

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp:132: error: cannot convert ‘const std::basic_string<char, std::char_traits, std::allocator >’ to ‘const char*’ in initialization

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp:157: error: ‘“Anti__ReportCheat: Player with no name?!?”’ cannot be used as a function

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp: In member function ‘void WorldSession::HandleMovementOpcodes(WorldPacket&)’:

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp:568: error: ‘plMover’ was not declared in this scope

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp:638: error: ‘MOVEMENTFLAG_JUMPING’ was not declared in this scope

[ 17%] Building CXX object src/server/game/CMakeFiles/game.dir/Movement/MovementGenerators/PointMovementGenerator.cpp.o[/CODE]

for the people tht want it i will add the ac1.patch.

again it merges but doesnt compile, or compiles with above errors.

so use at own risk and if you can help please contribute.

ac1.patch

okay i was able to crank out some compile errors but still i get a few, so who can help me out on this one.

[CODE]Building CXX object src/server/game/CMakeFiles/game.dir/PrecompiledHeaders/gamePCH.cpp.o

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp: In member function ‘bool Player::Anti__CheatOccurred(const char*, float, uint16, float, uint32, const MovementInfo*, bool)’:

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp:132: error: cannot convert ‘const std::basic_string<char, std::char_traits, std::allocator >’ to ‘const char*’ in initialization

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp: In member function ‘void WorldSession::HandleMovementOpcodes(WorldPacket&)’:

/home/trinity/TrinityCore/src/server/game/Handlers/MovementHandler.cpp:638: error: ‘MOVEMENTFLAG_JUMPING’ was not declared in this scope

make[2]: *** [src/server/game/CMakeFiles/game.dir/Handlers/MovementHandler.cpp.o] Error 1[/CODE]