void ConfusedMovementGenerator<Player>::Finalize(Player &unit)
{
    unit.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
    unit.ClearUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_CONFUSED_MOVE);
    unit.StopMoving();
    //   unit.ClearUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE);
}
void FleeingMovementGenerator<Player>::Finalize(Player &owner)
{
    owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
 //   owner.ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE);
    owner.ClearUnitState(UNIT_STATE_FLEEING | UNIT_STATE_FLEEING_MOVE);
    owner.StopMoving();
}
Exemple #3
0
 void OnEnterVehicle(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
 {
     Player* caster = GetCaster() ? GetCaster()->ToPlayer() : 0;
     if (caster)
         caster->ClearUnitState(UNIT_STATE_ONVEHICLE);
     // TODO: Check if this works, but due to the code below, GetCaster() should return the player. 
     // It appears that this function will be called after entering the "vehicle" arm. 
 }
void FlightPathMovementGenerator::Finalize(Player & player) {
	player.ClearUnitState(UNIT_STAT_IN_FLIGHT);

	float x = 0;
	float y = 0;
	float z = 0;
	i_destinationHolder.GetLocationNow(player.GetBaseMap(), x, y, z);
	player.SetPosition(x, y, z, player.GetOrientation());
}
void FlightPathMovementGenerator::Finalize(Player & player)
{
    player.ClearUnitState(UNIT_STAT_IN_FLIGHT);

    float x = 0;
    float y = 0;
    float z = 0;
    i_destinationHolder.GetLocationNow(player.GetBaseMap(), x, y, z);
    player.SetPosition(x, y, z, player.GetOrientation());

    /*-------------Anti-Cheat--------------*/
    player.Anti__SetLastTeleTime(uint32(time(NULL)));
    /*-------------------------------------*/
}
void FlightPathMovementGenerator::DoFinalize(Player& player)
{
    // remove flag to prevent send object build movement packets for flight state and crash (movement generator already not at top of stack)
    player.ClearUnitState(UNIT_STATE_IN_FLIGHT);

    player.Dismount();
    player.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);

    if (player.m_taxi.empty())
    {
        player.getHostileRefManager().setOnlineOfflineState(true);
        // update z position to ground and orientation for landing point
        // this prevent cheating with landing  point at lags
        // when client side flight end early in comparison server side
        player.StopMoving();
    }
}
 void OnEnterVehicle(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
 {
     Player* caster = GetCaster() ? GetCaster()->ToPlayer() : 0;
     if (caster)
         caster->ClearUnitState(UNIT_STATE_ONVEHICLE);
 }
voidFleeingMovementGenerator<Creature>::Finalize(Player &owner)
{
    owner.ClearUnitState(UNIT_STAT_FLEEING | UNIT_STAT_FLEEING_MOVE);
    if (owner.getVictim())
        owner.SetTarget(owner.getVictim()->GetGUID());
}
void FleeingMovementGenerator<Player>::Finalize (Player &owner)
{
    owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
    owner.ClearUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING);
}